In win forms I have a report selector form and a report viewer form. I populate the report selector list from a database. This lets me add new reports without changing the code in either form. However, I cannot figure out how to call the user selected report generically. What I can do is to hard code the selection options in the viewer using a case statement:
Select Case param 'param is a String of the user's selection passed from the calling form
Case "Report1"
Me.ReportViewer1.Report = New MyClassLib.Report1
Case "Report2"
Me.ReportViewer1.Report = New MyClassLib.Report2
End Select
To make it more generic I want to use the passed parameter to specify the report. Something like this:
Me.ReportViewer1.Report = New MyClassLib.param
Any suggestions as to how to accomplish this?
Thanks, Matthew
Select Case param 'param is a String of the user's selection passed from the calling form
Case "Report1"
Me.ReportViewer1.Report = New MyClassLib.Report1
Case "Report2"
Me.ReportViewer1.Report = New MyClassLib.Report2
End Select
To make it more generic I want to use the passed parameter to specify the report. Something like this:
Me.ReportViewer1.Report = New MyClassLib.param
Any suggestions as to how to accomplish this?
Thanks, Matthew