65.9K
CodeProject is changing. Read more.
Home

How to create a Crystal Reports report from a dataset

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.75/5 (4 votes)

Aug 9, 2010

CPOL
viewsIcon

51981

downloadIcon

6

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();