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();
I am a Software Specialist.Worked & Working in Various IT Based industries.I have good Exposure in ASP.net, C# and other Microsoft Technologies.