using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; // Load the report ReportDocument report = new ReportDocument(); report.Load(@"C:\Reports\MyReport.rpt");
Here’s a showing how to load and set a database connection for a Crystal Reports report at runtime in a .NET application (C#):
// Assign to CrystalReportViewer crystalReportViewer1.ReportSource = report;
Requires CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared DLLs (SAP Crystal Reports runtime for .NET).