Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display DataTable with CrystalReports

Status
Not open for further replies.

lutzs

Programmer
Oct 8, 2002
75
LU
Hi,

for many days I'm concerning with the following problem:
I have a .net application with a crystal report.
There is a dataSet with 3 tables. Two tables are from my database (Table KUNDE and BESTAND).
For the third table DTT I've created a DataTable with datacolumns.
My problem is representing contents of this third table.

I can show the data in the table (dataGrid) but not on the report.
I can just see the report header and the details section in cr is empty.

That's my code:
...
// add the table dtt to the dataSet
dataSet.Tables.Add(dtt);

// Output DataGrid
dataGrid1.DataSource = dtt;

// Output CrystalReports
CrystalReport1 oRpt = new CrystalReport1();
oRpt.SetDataSource(dataSet.dtt);
crystalReportViewer1.ReportSource = oRpt;


That's my proceeding:
- add new item CrystalReport1.rpt
- DatabaseExpert> Project Data> ADO.net DataSets> choose the table DTT
- insert the database fields on my report

For example, when I add the table KUNDE the data are displayed with the CrystalReportViewer.

Also the FAQ of mike_nz I read already several times:
- the database is up to date (verify database)
- i have deleted the viewer an add it again to clear it's properties
- there are no report criteria
- the dataset is filled because I can see the data in a datagrid

What's the problem?

Thanks, Stephanie
 
Here's an example I found, there are plenty of others out there:

Dim myDS As New Dataset1()

'This is our DataSet created at Design Time
MyDA.Fill(myDS, "Stores")
'You have to use the same name as that of your Dataset that you created during design time
Dim oRpt As New CrystalReport1()
' This is the Crystal Report file created at Design Time
oRpt.SetDataSource(myDS)
' Set the SetDataSource property of the Report to the Dataset
CrystalReportViewer1.ReportSource = oRpt
' Set the Crystal Report Viewer's property to the oRpt Report object that we created

-k
 
Thank you. It's the same like in my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top