Results 1 to 4 of 4

Thread: [RESOLVED] "Adding subreports at runtime"

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251

    Resolved [RESOLVED] "Adding subreports at runtime"

    I am using Reporting Services in my C# application, and would like to configure a main report at runtime depending on options selected by a user in my application.

    For example the user could select to leave out certain sections or even reorder some sections in the main report.

    To do this I would guess the best option would be to design the sections as subreports and then at run time insert the subreport into the main report.

    Unfortunately I cannot find out how to do this. I can add subreports at design time into my main report and this works well, but unfortunately this will not solve my problem.

    I would appreciate any help suggestion or links regarding this.
    Control Data Systems
    www.members.shaw.ca/cdsystems

  2. #2
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: "Adding subreports at runtime"

    Ok , i have also not find any thing related to adding sub reports at run time. For ur scenario u have to first decide that how many choice will u give it to the user and then u have to work it programtically that u need to suppress one report and show other or use the formula fields and etc etc.

    But this will be really a tough task.
    Thanks and Regards,

    Muhammad Abbas

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251

    Re: "Adding subreports at runtime"

    Thank for your advice.

    Actually I managed to get the report constructed programatically. What I did is create all the sections as separate reports that can run individually.

    Then using the xmlWriter I create a main rdlc file (xml file) , from scratch and insert the the subreports as selected by the user, and in the order that the user selects.

    Unfortunately this is not an easy task, and that is not due to the programming side but due MS problems. An example is that the ReportViewer cannot find the subreport if you add an extension to the Reportname, ie mySubreport.rdlc does not work but mySubreport does.

    Another problem is that the assembled main report has to be created in the directory where the subreports exist, as the route of the subreports gets taken from the path specified by the main report.

    Anyway with a lot of pain and suffering it works.
    Control Data Systems
    www.members.shaw.ca/cdsystems

  4. #4
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: "Adding subreports at runtime"

    IF this problem has solved , then u must marked it as resolved.
    Thanks and Regards,

    Muhammad Abbas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width