Skip to Content
0
Jul 15, 2019 at 02:33 PM

Crystal Reports on Windows 10 64-bit using CR13 runtimes fails

3285 Views Last edit Jul 16, 2019 at 02:36 PM 2 rev

Hello,

I am facing an issue to generate the reports in 64-bit OS. I am using CR13 .Net runtimes. Same code works with 32-bit not a problem at all, but 64-bit it throws an exception "A first chance exception of type 'CrystalDecisions.CrystalReports.Engine.DataSourceException' occurred in CrystalDecisions.ReportAppServer.DataSetConversion.dll".

Things to be noted:

1. I face this issue with both dataset and when connecting to the database.

2. Following is the source code we use a C++ Windows application and use Managed CLR project to call the crystal .Net APIs:

	reportDoc->ReportOptions->EnableSavePreviewPicture = false;
	reportDoc->ReportOptions->EnableUseIndexForSpeed = true;
	reportDoc->ReportOptions->EnableSaveDataWithReport = false;
	CrystalDecisions::Shared::ExportOptions ^exportOpts = reportDoc->ExportOptions;
	CrystalDecisions::Shared::DiskFileDestinationOptions ^diskOpts = exportOpts->CreateDiskFileDestinationOptions();
	diskOpts->DiskFileName = gcnew System::String(filePath);
	exportOpts->ExportDestinationOptions = diskOpts;
	exportOpts->ExportDestinationType = CrystalDecisions::Shared::ExportDestinationType::DiskFile;
	SetPDFExportOptions(exportOpts);//Function is defined below for reference
	reportDoc->Export(exportOpts);//This is where I get an exception
	void SetPDFExportOptions(CrystalDecisions::Shared::ExportOptions ^exportOpts)
	{
		exportOpts->ExportFormatType = CrystalDecisions::Shared::ExportFormatType::PortableDocFormat;
		CrystalDecisions::Shared::PdfFormatOptions ^pdfFormatOptions = exportOpts->CreatePdfFormatOptions();
		pdfFormatOptions->UsePageRange = false;
		exportOpts->ExportFormatOptions = pdfFormatOptions;
	}

Can anyone help out?

Thanks,

Jai