Hi,
i will export a report (created with an ado.net Dataset)
to pdf. What's wrong in my code?
private void button1_Click(object sender, System.EventArgs e)
{
string exportFilePath = "c:\\exported.pdf";
crReportDocument = new ReportDocument();
crReportDocument.Load("c:\\CrystalReport1.rpt"
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = exportFilePath;
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
}
The error message is:
An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.LogOnException'occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Logon failed.
Can I load the CrystalReportViewer not the file path with the report?
>> crReportDocument.Load("c:\\CrystalReport1.rpt"
Thanks,
Stephanie
i will export a report (created with an ado.net Dataset)
to pdf. What's wrong in my code?
private void button1_Click(object sender, System.EventArgs e)
{
string exportFilePath = "c:\\exported.pdf";
crReportDocument = new ReportDocument();
crReportDocument.Load("c:\\CrystalReport1.rpt"
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = exportFilePath;
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
}
The error message is:
An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.LogOnException'occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Logon failed.
Can I load the CrystalReportViewer not the file path with the report?
>> crReportDocument.Load("c:\\CrystalReport1.rpt"
Thanks,
Stephanie