This is a migrated thread and some comments may be shown as answers.

Dynamic Report Creation

1 Answer 237 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Danielle Ferguson
Top achievements
Rank 1
Danielle Ferguson asked on 11 Sep 2007, 07:53 PM

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;

 

1 Answer, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 18 Sep 2007, 06:06 PM
Hi Tom,

Yes, this is the right place (near the ReportViewer) where you can put the logic for DatatTableAdapters selection and report binding.
 

Best wishes,
Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Danielle Ferguson
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Share this question
or