Load multiple datasets to crystal report.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I like to use .SetDataSource() to load several data tables from different
datasets to a crystal report. I was thinking to create a new dataset to have
all these tables. But is there a way to load them directly?

Thanks in advance.

Li
 
Hi Li,

You can specify different data tables by "dataset.Tables[id]" or
"dataset.Tables[name]".
For example:
SetDataSource(dataset1.Tables[0])
SetDataSource(dataset2.Tables["TableName"])
Do you meet any further issue on this?

Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi, Wen Yuan:

Thanks for the response.
Yes, I tried that. But look like if the tables are from the different
datasets, it doesn't work.
Have you run it (from different datasets) on your test machine and got the
records successfully? If yes, could you post your test codes and any
"special" settings in Crystal report?

Thanks.

Li
 
Hi Li
Thanks for your reply.

I tried the following code. But, I meet the same issue. It doesn't work on
my side.
DataSet1 ds1 = new DataSet1();
DataSet1TableAdapters.ProductTableAdapter pta = new
WindowsApplication4.DataSet1TableAdapters.ProductTableAdapter();
pta.Fill(ds1.Product);
CrystalDecisions.CrystalReports.Engine.ReportDocument rdDisplay = new
CrystalDecisions.CrystalReports.Engine.ReportDocument();
rdDisplay.Load("CrystalReport1.rpt");
rdDisplay.SetDataSource(ds1.Tables[0]);
this.crystalReportViewer1.ReportSource = rdDisplay;
DataSet2 ds2 = new DataSet2();
DataSet2TableAdapters.AddressTableAdapter pta2 = new
WindowsApplication4.DataSet2TableAdapters.AddressTableAdapter();
pta2.Fill(ds2.Address);
rdDisplay.SetDataSource(ds2.Tables[0]);

I'm sorry to say this issue is related to Cystal Report Development.
However, it is not supported by Microsoft. For crystal report issue, I
suggest you may contact crystal report support for help directly:
http://support.businessobjects.com/

You may also post it in Crystal Report forum.
http://www.tek-tips.com/threadminder.cfm?pid=767

For the detailed information on the licensing and support on Crystal
Report, you may refer the following KB article
INFO: Licensing and Support for Crystal Reports for Visual Studio .NET
http://support.microsoft.com/?id=317789

Hope this helps,
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top