C# – Crystal Reports in Visual Studio 2008

ccrystal-reportsvisual-studio-2008

I have embedded some crystal reports in my C# application. The problem is, compiling the project creates dlls for the reports also, which means in future any change in report will need re-installation of the application. Is there any way that I can keep them as .rpt files and they can be changed any time by just copying the .rpt file into application folder??

Thanks 🙂

Best Answer

You can use ReportDocument.Load method.

ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(reportName, OpenReportMethod.OpenReportByTempCopy);
crystalReportViewer.ReportSource = reportDocument;