How to pass NET dataset to Crystal using ReportDocument Class 
Author Message
 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



Sun, 10 Jul 2005 04:11:23 GMT  
 How to pass NET dataset to Crystal using ReportDocument Class
I found the problem.  When I saved the Crystal
report, 'Save data with Report' was checked.  As soon as I
unchecked it and re-saved the report, it worked fine.  
Hopefully, my experience will help someone else out there.

Quote:
>-----Original Message-----
>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
>.



Sun, 10 Jul 2005 06:41:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing Dataset to Crystal Report in VB.Net

2. Using DataSet In the Crystal report.NET

3. How to generate dataset class from dataset xsd file

4. Passing Classes to other classes (using user defined types)

5. I cannot believe no one knows how to pass a dataset or datatable to Crystal

6. Crystal Report based on ADO.Net dataset prompts for database login

7. crystal.net dataset changes - error Query Engine Error

8. programmatically adding ADO dataset to crystal report in .NET

9. Sorting in Vb.net crystal reports dataset

10. Using DataSet's in a class - problem

11. No ReportDocument Intellisense in NET

12. ASP.Net ReportDocument hangs up

 

 
Powered by phpBB® Forum Software