cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

View Entire Topic
0 Kudos

Hi Jai,

What I suggest for new comers is to open reports in CR Designer, full version not the one embedded in VS. In your case open the report and set DB location in the DB menu, select the TTX if you have it if not then select the XML file, requires the Schema to be embedded in it also. Then Verify, if anything doesn't match a Mapping pop up will show up, fix your data source.

Be default when you did select ttx a default dummy set of data was used until the data file was found.

Play with the designer first, .NET SDK uses the same features so the work flow is the same. Once you get one report converted search for this KBA -

1553921Is there a utility that would help in writing database logon code?

Run the app and it will generate the connection info required to convert the reports data source in code. Then use a Flag to show if the reports been converted, if it has don't jump into that routine. If it hasn't then save it as a new file and/or use it from now on...

Lot's of sample code out there, main download WIKI has 2 samples also, one for parameters, which has log on code, and one for printing...

Don