[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.
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.
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.
Re: "Adding subreports at runtime"
IF this problem has solved , then u must marked it as resolved.