
How to pass NET dataset to Crystal using ReportDocument Class
I am writing a generic reporting application using VB.NET,
Crystal Reports 9, and SQL Server 2000.
The Crystal report name and the SQL stored procedure name
are read from a database table. The stored procedure is
used to create an ADO dataset. I then want to pass both
the report name and the dataset to a Windows form that
loads the report using the dataset passed in and then
display in the Crystal report viewer.
If I use a strongly-typed report document (which means I
have to include each report definition within the VB.NET
project), everything is ok and the report displays the
data correctly. When I use the reportDocument class, the
report loads but there is no data.
The following doesn't work:
Dim crReportDocument As New ReportDocument()
crReportDocument.Load(myCRystalname)
crReportDocument.SetDataSource(myDataSet)
where myCrystalName is the Crystal report file path and
name
and myDataSet is an ADO dataset
If I do the following, it's ok.
Dim crReportDocument as New stronglyTypeReport()
crReportDocument.SetDataSource(myDataSet)
Any solution out there? Thanks,
Nancy