Skip to Content
0
Former Member
Aug 04, 2008 at 06:51 PM

Data in DataSets, but error when trying to populate Crystal Report

51 Views

I have been in the process of making changes to a legacy application as described in this post. [Error received on windows application|Error received on windows application]

I have changed the references from 10.0 to 10.2. The application included references to CrystalDecisions.CrystalReports.Design, CrystalDecisions.Enterprise.Framework and CrystalDecisions.Enterprise.InfoStore which did not have a comparable version in 10.2, so for the moment I have removed them.

I have then tried to run the application (compiles fine) and run into this error:

A first chance exception of type 'System.Exception' occurred in CrystalDecisions.CrystalReports.Engine.dll

The code where it fails is here, when it is trying to load it into the report:

private void SendDailyRentalDataToCrystal()

{

crystalFailure = false;

try

{

crystalDailyRentalReport.Database.Tables["ReportParameters"].SetDataSource(dsDailyRentalParameters);

crystalDailyRentalReport.Database.Tables["ReportData"].SetDataSource(dsDailyRentalData);

}

catch

{

crystalFailure = true;

string error = "Unable to generate the Daily Rental Report. ";

error += "There was a problem sending the data to Crystal Reports.";

System.Windows.Forms.MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

The DataSet visualizers for dsDailyRentalParameters and for dsDailyRentalData both indicate that there is valid data being returned from SQL Server. This code is part of a Win32 application developed using VS 2005 and the reports were originally developed using Crystal Reports 10.

Thanks for any help that you can provide.