cancel
Showing results for 
Search instead for 
Did you mean: 

ReportDocument.SetDataSource - crdb_adoplus.dll

Former Member
0 Kudos

Hi

I hope someone can help me. I installed the latest runtime version for SAP Crystal Reports. (CRforVS_redist_install_32bit_13_0).

I have Crystal Report that needs to be distributed to mulitple machines each with a local SQL Express Database.

This mean I would need to specify the datasource for each Report in a config file.

But when I do the ReportDocument.SetDataSource I get the following error :

"Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified."

Sample Code :

try

{

dataClass dc = new dataClass();

string path = System.Reflection.Assembly.GetExecutingAssembly().Location;

path = path.Replace("TestApp.exe", "");

CrystalDecisions.CrystalReports.Engine.ReportDocument testRep = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

testRep.FileName = path + "testReport.rpt";

testRep.SetDatabaseLogon("", "", "PC
SQLEXPRESS", "testDB");

//This class returns a DataTable and this is where the above mentioned error occur.

//*****************

testRep.SetDataSource(dc.testReport());

//*****************

testRep.Load(testRep.FileName);

crystalReportsViewer1.ViewerCore.ReportSource = testRep;

}

catch (Exception EX)

{

MessageBox.Show("Report Error : " + EX.Message);

}

If someone could please tell me what I'm doing wrong or why I dont have a directory as mentioned in the error :

C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll'

Any help would be appreciated

Regards,

Gerhard.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Gerhard,

If you search on the dll name you'll find this link and other, this one explains how to fix the issue:

Bottom line is Microsoft has changed their dependencies so CR needs to use the old 2.0 framework functionality for that driver.

Thank you

Don

richard_sims
Member
0 Kudos

Creating the app at .NET 3.5 does solve the problem. Does SAP intend to fix this for 4.0?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Thank you for the answers.

I got the problem solved. I simply added the following to my App.config file :

<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

The "useLegacyV2RuntimeActivationPolicy="true" seemed to enable the app to make use of the .dll without changing the entire project back to .net 3.5

Thank you.

Regards,

G.T.

Former Member
0 Kudos

This bug needs to be fixed ASAP. This is a terrible. We have had to add 50+ app.config files to our product simply because of this stupid bug. You have to even add the app.config files if you use COM Interop. This was an issue using Crystal Reports 2008 in .Net 4, and we expected it to be fixed in Crystal Reports 2010.

All Crystal Reports assemblies should load natively in .NET Framework 4.0! Additionally, they should be natively compiled and running in .Net 4, not .Net 2! Even though it is called "Crystal Reports for .NET Framework 4.0", it is not. It is for .NET Framework 2.0 and isn't even properly compatible with the 4.0 framework. What a terrible release.

Kyle

former_member183750
Active Contributor
0 Kudos

Note the post from Mandeep (Program Management) dated Aug 27, 2010:


In order to support .NET 2.0 Framework scenarios, the runtime components are compiled for .NET 2.0 framework support. The .NET 3.5 and 4.0 Frameworks scenarios are tested and show full compatibility. This issue occurs because of how the .NET Framework 4.0 changed it's loading behavoiur for mixed-mode components; this issue does not exist with the .NET 3.5 Framework.

The above appears to say that at this time, there is not much SAP can do. I will highlight this thread to Mandeep and see if he can pipe in.

Ludek

Former Member
0 Kudos

Hello! There are 2 things that cause this issue...

1) CR runtime supports .NET Framework 2.0, 3.0, 3.5, and 4.0.

2) .NET Framework 4.0 changed how it loads mixed-mode components; it worked with .NET Framework 3.5.

I'm re-iterating my comment from the referenced thread (above):

In order to support .NET 2.0 Framework scenarios, the runtime components are compiled for .NET 2.0 framework support. The .NET 3.5 and 4.0 Frameworks scenarios are tested and show full compatibility. This issue occurs because of how the .NET Framework 4.0 changed it's loading behavoiur for mixed-mode components; this issue does not exist with the .NET 3.5 Framework.

Unfortunately, there is no easy fix for this issue.

-Mandeep

former_member183750
Active Contributor
0 Kudos

Many thanks Mandeep!

Ludek

Former Member
0 Kudos

I understand there is not an easy fix to the issue, but the reality is that if I have to add an app.config file to every program in my system to change the method of loading assemblies to a legacy mode, then CR2010 is simply not .Net 4 compatible. They are the only .Net 4 "compatible" assemblies that I have to do this for. The only option for us to get around it is to convert hundreds of our reports and customer reports to not use any sort of Field Definition File or DataSet/DataTable based source, or we have to add 50+ app.config files to our program's install just to allow it to print properly. It is not acceptable for us to have to change all of our .Net 4 compatible exes and assemblies to load using legacy methods. What's the point of moving to the current platform if it cannot be used as intended?

I believe the proper fix for this issue is for the incompatible assemblies to be properly updated to run natively in .Net 2/4. I know in CR2008 the assembly that referenced DataSets and DataTables was a .Net 1.1 assembly. Is it still?

As for .Net 2 vs .Net 4, I think SAP could offer two different versions of the runtime, but that is not nearly as important to me as getting rid of all these app.config files and legacy loading. Please consider prioritizing and updating the assemblies so we do not have to load in a mixed-mode environment. Thanks.

Kyle

Edited by: kmfisher on Nov 18, 2010 2:24 PM