0
votes

I have been having this problem for quite some time. I create a dataset from project explorer.

I add in a datatable. Name it and fill the column names.

I create a crystal report from project explorer and fill it with the table from database expert. I can find the table name and use it.

I create another datatable into the same dataset.

I go to database expert in the crystal report to add in that table also.

Or I creat a new crystal report. But I can't find any table in the dataset anymore.

Why is that? Do I need to link the table or something?

1
How are you adding and referencing the DataTables in the DataSet? Show us your code.David
A DataSet can contain many DataTables. Don't know if there is a hard upper limit or if it simply constrained by memory, but the number is well north of 1. Don't know much about Crystal Reports, but perhaps you can get some more help if you post some sample code.Anthony Pegram
If there were a limit to the number of DataTables, then adding one over the limit would have thrown an exception. It would not have failed silently.John Saunders
There is no code. in VS 2005, there is a project explorer. Right click to the project, add new item, dataset. Open the dataset, right click, add datatable. Do it twice. On the project, right click, add new item, crystal report. In set up step, on the second step, u add the datatable to the crystal report. If the dataset has only one table, I can see the table. If more than one table, I see no items found.. ???william

1 Answers

1
votes

AFAIK, its possible to have crystal report bound to a dataset having two tables - however, they must have a relationship among them. This is because crystal report cannot report from multiple data sources - so essentially, we had to join the data from both table to create a single projection that can be bound with crystal report. For multiple data sources, one has to use sub-report. Please refer below articles that describes how to use multi-table datasets:

http://www.aspfree.com/c/a/Database/Generating-a-Multiple-Table-Crystal-Report-using-VS-2005/

http://www.highoncoding.com/Articles/556_Creating_Crystal_Report_with_Multiple_Tables_in_ASP_NET.aspx

http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

First two uses Report Wizard but you can always look at generated report/dataset to understand how it is done.