How to create a Crystal Reports report from a dataset






3.75/5 (4 votes)
Creating a Crystal Reports report from a dataset
First create a CrystalReportViewer
and then CrystalReport
. Create a dataset, and in the dataset, create a table using the table adapter tool. Add columns in the table. The content of the table must be same as the content that is retrieved. Now consider report viewer as rpviewer
and report as rpt
. Write the code below to bind the dataset with the crystal report (rpt
).
Query = .....;
adapter.fill(datasetname,"table name of the dataset");
rpt.setdatasource(datasetname);
rpviewer.reportsource = rpt;
rpviewer.refresh();