Introduction: In this article I will explain how to save the
CrystalReport as PFD file. Saving pdf format of crystalreports is very
important to keep the record.
Code :
Here is the complete code:
try
{
if (!Directory.Exists("D:\\Sanjeev\\"))
{
Directory.CreateDirectory("D:\\Sanjeev\\");
}
ExportOptions CrExportOptions;
DiskFileDestinationOptions
CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions
CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "D:\\Sanjeev\\newpdf.pdf";
CrExportOptions = b.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
b.Export();
}
catch (Exception
ex)
{
MessageBox.Show(ex.ToString());
}
No comments:
Post a Comment