Visual Studio Development Bookmark and Share   
 index > Crystal Reports for Visual Studio > How to bind a report to multiple DataTables
 

How to bind a report to multiple DataTables

Is it possible to set the Data Source of a CR to multiple DataTables?  I am trying to generate a report based upon information a user inputs on a form.   So I capture the values and build typed DataTables.  However, if I try to set the DS to more than one of the tables, nothing is displayed.  If I just set the DS to a single DT, everything is fine, but I have a situation where I need to have multiple tables.

Example:

This works:

CrystalReport report = new CrystalReport();
report.SetDataSource(ds.Tables["dtOne"]);

This doesn't:

CrystalReport report = new CrystalReport();
report.SetDataSource(ds.Tables["dtOne"]);
report.SetDataSource(ds.Tables["dtTwo"])
jaden403  Wednesday, October 07, 2009 11:31 PM

Hi,

Please try to set the datasource to the dataset.
You might also want to create sub reports to show different datatables.

Harry


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Harry Zhu  Friday, October 09, 2009 7:10 AM

Hi,

Please try to set the datasource to the dataset.
You might also want to create sub reports to show different datatables.

Harry


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Harry Zhu  Friday, October 09, 2009 7:10 AM

You can use google to search for other answers

Custom Search

More Threads

• charts
• Grouping problem
• Set DataSource to subreport
• Visual Studio Report - Drill Down Matrix
• Multiple .NET Objects as DataSource
• Setting Page Orientation of a report/crystal report viewer at runtime
• trying to export file from asp.net application and getting LoadSaveReportException: Invalid file name.
• Report Database.Table.Field type auto converted
• Embeddable Crystal Reports Designer 2008 (CRDesignerCtrl.dll) Missing ?
• Create typed dataset for report using code.