Tuesday, 6 March 2012

How to View a Crystal Report in Crystal Report Viewer C#


Namespaces:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

Code:
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("F: /WindowsFormsApplication1/CrystalReport1.rpt");                         //report path
cryRpt.SetDataSource(dt);                                                                //dt->datasource (datatable or ….)
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();

No comments:

Post a Comment

IE7 Issues Text Indent

                 Unfortunately IE 7 is still widespread among the users hence while theming we have to give special importance to the grea...