Showing posts with label Crystal Reports 13. Show all posts
Showing posts with label Crystal Reports 13. Show all posts

Tuesday, July 23, 2013

Dummy data in Crystal Report at runtime

When using Crystal Reports, in Design mode, you preview your report by clicking "Main Report Preview".

To bind the report I use:
crDaily1.SetDataSource((DataTable)dtDaily);
crDaily1.SetParameterValue("pPeriod", title);

If I put this code in
private void FormReportDaily_Shown(object sender, EventArgs e)
sometimes the dummy data that appears in "Main Report Preview" is shown at runtime. I really don't know the reason?!.

Resolution:

Put the binding code
crDaily1.SetDataSource((DataTable)dtDaily);
crDaily1.SetParameterValue("pPeriod", title);

in the constructor:
public FormReportDaily()

Friday, March 23, 2012

Error when changing an applications Target Framework from 2.0 to 4.0

I've had a problem with Crystal Reports when changing an applications Target Framework from 2.0 to 4.0 

Error:
Could not load file or assembly 'file:///C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.

Resolution:
Add the following to app.config:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime Version="v4.0" sku=".NETFramework, Version=v4.0" />
startup>
 
 
System: VS 2010, Crystal Reports 13, Windows 7 x64