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;