Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Exporting to PDF of crystal report throws Exception
Mark White
Jan 19 2017 12:14 AM
295
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
How to repeat the SSRS design for multiple time ?
How to create detail sub report and main report in crystal?