Problem with Crystal reports and DataTables Created by my Program
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.
开发者_如何学JAVAOr 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?
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.
精彩评论