Has anyone tried to dynamically pass in DataTableMapping and DataColumnMapping to a report that has been created? I am attemtping to do this. I have various reports and based on the report I select, I pass in the dataadapter and connection string.
string strSP = name of stored procedure
sqlSelectCommand1.CommandText = "dbo." + strSP;
sqlSelectCommand1.CommandType = CommandType.StoredProcedure;
sqlConnection1.ConnectionString = SqlClient.GetConnectionStr();
sqlSelectCommand1.Connection = sqlConnection1;
sqlDataAdapter1.SelectCommand = sqlSelectCommand1;
Can I do the mapping in this code or do I have to do the mappings within the report itself?
Report report = new Report();
report.DataSource = sqlDataAdapter1;
ReportViewer1.Report = report;
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
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
[OverflowException: Overflow error.] |