Exporting crystal report to pdf
Hi all,
i need to export crystal report to pdf.I am doing it in c#.net. In fact i have done the coding for it and the problem is , when i click on the export button it shows the message like "invalid report file path". Here is the code for my export button event.
private void btnExport_Click(object sender, EventArgs e)
{
try
{
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = @"C:\\test.pdf";
CrExportOptions = rpt.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
rpt.Export();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Waiting for the reply,
Thanks,
ruchi