Hi,
I am trying to Export crystal Report to PDF and tried numerous steps you can refer my other posts HERE: https://www.codeproject.com/Questions/1165812/Exporting-crystal-report-to-PDF-gives-missing-para
but none of them worked. Recently I tried using this code:
- cryRpt = new ReportDocument();
- cryRpt.Load("E:\\Office\\Clients\\Bombay Restaurant\\Banquet New - MySql\\Banquet New\\RPTBanQoute.rpt");
- crystalReportViewer1.ReportSource = cryRpt;
- crystalReportViewer1.Refresh();
- try
- {
- ExportOptions CrExportOptions;
- DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
- PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
- CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net-informations.pdf";
- CrExportOptions = cryRpt.ExportOptions;
- {
- CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
- CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
- CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
- CrExportOptions.FormatOptions = CrFormatTypeOptions;
- }
- cryRpt.Export();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
But this gave me an exception :
So what am I dong wrong , I am also passing around 4 parameters to this RPT