DataSet to Crystal report?

  • Thread starter Thread starter krunom
  • Start date Start date
K

krunom

Hi,

i am a newby in Crystal Reports design, and i wrote a c# windows form
application that creates a DataSet.

And, now i want to pass this DataSet to CrystalReport (via DataSource?) and
i do not know how to display this DataSet in my Crystal Report :(


Please, help.
 
Hi,

CR create a new class per report, you can instantiate this class and assing
the dataset you created to it, note that the schema should be the same .
Here is a piece of code that does just that:

DataSet ds = dbm.GetPPCDelaysBetweenDates(fromDate, toDate); //populate the
DS

CrystalDecisions.CrystalReports.Engine.ReportDocument theReportDoc = new
PPCSyncDelay_Report(); // PPCSyncDelay is the name of my report

theReportDoc.SetDataSource(ds); //set the datasource of the report

//Set the viewer
CrystalReportViewer1.ReportSource = theReportDoc;
CrystalReportViewer1.DataBind();
 
Back
Top