I am working with crystal report export pdf with the below code, but when exporting to pdf the error is coming at line no 9.
Error: Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'.
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("FrontRor_S.rpt"));
DataSet ds = GetData();
DataTable dt = new DataTable();
dt = ds.Tables[0];
crystalReport.SetDataSource(dt);
CrystalReportViewer1.ReportSource = crystalReport;
ExportFormatType formatType = ExportFormatType.PortableDocFormat;
crystalReport.ExportToHttpResponse(formatType, Response, true, "Crystal");
Response.End();
ExportOptions CrExportOptions ;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "C:\\SampleReport.pdf";
CrExportOptions = doc.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
doc.Export();
Please try this code after crystalReport.SetDataSource(dt);
This will definitely works.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.