I am working on a dynamic feature where a report is loaded in a reportviewer. I have a dropdownlist where the user can select one of the reports. The selected report is then loaded in the viewer.
Each value in the dropdownlist called ddl1 is the name of the reporting class that I want to view. For example, a user selects "InvoiceReport"...I would like the following to happen.
Each value in the dropdownlist called ddl1 is the name of the reporting class that I want to view. For example, a user selects "InvoiceReport"...I would like the following to happen.
ReportViewer1.Report = new InvoiceReport();
I am unable to accomplish this because this is the code I have.
string strddl = ddl1.SelectedItem.Value + "()";
ReportViewer1.Report = new strddl;
Or I have been trying to do this as well...
Telerik.Reporting.Report report = (Telerik.Reporting.Report)ddl1.SelectedItem.Value;
How do I pass in the string value of the report name into the reportviewer1.report loading declaration?
Have any ideas?
Thanks