Hello,
I have a generic page that has a ReportViewer control on it. The Page_Load event collects some querystring parameters and uses them to open the appropriate report. For example, here is some sample code:
My real application will eventually have well over 100 reports. I'm looking for a way to parameterize this so that I don't need the Select Case statement at all. For example, in my database I have a table that tracks the IDs and associated reports. Is there a way for me to do something like this:
The parameters are always identical as well.
Thanks.
Steve
I have a generic page that has a ReportViewer control on it. The Page_Load event collects some querystring parameters and uses them to open the appropriate report. For example, here is some sample code:
Select Case intReportID Case 1 rptViewer.Report = New MyReportingProject.Report1(param1, param2, param3) Case 2 rptViewer.Report = New MyReportingProject.Report2(param1, param2, param3) Case 3 rptViewer.Report = New MyReportingProject.Report3(param1, param2, param3)End SelectMy real application will eventually have well over 100 reports. I'm looking for a way to parameterize this so that I don't need the Select Case statement at all. For example, in my database I have a table that tracks the IDs and associated reports. Is there a way for me to do something like this:
rptViewer.Report = New Report([strReportName])(parameters need to be passed to the New method of the report as well)The parameters are always identical as well.
Thanks.
Steve