Hi,
i show an existing report with the crystalreportviewer.
There exist a button "export" to export the report.
But I will export the report to pdf automatically, without click the button.
I work with the sample report from Microsoft Visual Studio.net:
C:\Program Files\Microsoft Visual Studio.net\CrystalReports\Samples\Code\Winforms\C#\Simple.csproj
When I click the button "export" in the crystalreportviewer I get this error message:
"Error in file C:\Program Files\Microsoft Visual Studio.net\CrystalReports\Samples\Code\Winforms\C#\Simple.csproj
Operation not yet implemented"
"Export failed"
When I will export the file automatically with this code, I get this error message, too:
ReportDocument crReportDocument;
ExportOptions crExportOptions;
DiskFileDestinationOptions crDiskFileDestinationOptions;
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string exportFilePath = "c:\\exported.pdf";
crReportDocument = new ReportDocument();
crReportDocument.Load(@"C:\\Program Files\\Microsoft Visual Studio .NET\\Crystal Reports\\Samples\\Reports\\General Business\\Income Statement.rpt"
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = exportFilePath;
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
MessageBox.Show("Report exported"
}
catch (Exception excp)
{
MessageBox.Show(excp.ToString());
}
When I open the .rpt with Crystal Reports I can export the report.
What's the problem?
Thanks,
Stephanie
i show an existing report with the crystalreportviewer.
There exist a button "export" to export the report.
But I will export the report to pdf automatically, without click the button.
I work with the sample report from Microsoft Visual Studio.net:
C:\Program Files\Microsoft Visual Studio.net\CrystalReports\Samples\Code\Winforms\C#\Simple.csproj
When I click the button "export" in the crystalreportviewer I get this error message:
"Error in file C:\Program Files\Microsoft Visual Studio.net\CrystalReports\Samples\Code\Winforms\C#\Simple.csproj
Operation not yet implemented"
"Export failed"
When I will export the file automatically with this code, I get this error message, too:
ReportDocument crReportDocument;
ExportOptions crExportOptions;
DiskFileDestinationOptions crDiskFileDestinationOptions;
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string exportFilePath = "c:\\exported.pdf";
crReportDocument = new ReportDocument();
crReportDocument.Load(@"C:\\Program Files\\Microsoft Visual Studio .NET\\Crystal Reports\\Samples\\Reports\\General Business\\Income Statement.rpt"
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = exportFilePath;
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
MessageBox.Show("Report exported"
}
catch (Exception excp)
{
MessageBox.Show(excp.ToString());
}
When I open the .rpt with Crystal Reports I can export the report.
What's the problem?
Thanks,
Stephanie