cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot run web app with Crystal Report for 64-bit web app

valentinakirnishni
Discoverer
0 Kudos

Hello,

I've installed Crystal Reports runtime engine for .NET Framework (64-bit) and Crystal Report, version for Microsoft Visual Studio(CRforVS_redist_install_64bit_13_0_23). The application is compiled as 64-bit app. It is using 64-bit Oracle Client. The app pool on IIS is for .NET CLR version: v4.0. Enable 32-bit applications: false.

With these settings I can run the app and access the database but cannot run reports:"Could not load file or assembly 'Reports' or one of its dependencies. An attempt was made to load a program with an incorrect format."

When I set Enable 32-bit applications to true than I can run reports but get Oracle exception.

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Ah, check the CR assemblies, and try setting the Embedded Interopt Type to False in the properties of the assemblies:

CrystalDecisions.CrystalReports.Engine

CrystalDecisions.Shared

CrystalDecisions.ReportSource

and if you are using it:

CrystalDecisions.ReportAppServer.DataSetConversion

Don

valentinakirnishni
Discoverer
0 Kudos

Embedded Interop Type on CR assemblies was set to False.

Adding assembly redirect to 64-bit dlls in assemblyBinding in web.config did the trick.

Answers (1)

Answers (1)

0 Kudos

Add the CR for VS tag and will remove the CR SDK tag soon...

Use ProcessMonitor and see where it's loading the assemblies from, should be the GAC.

When you installing you must install as an Administrator

Try a test report with no DB connection info and just a text box with "Hello World" in it.

"Reports" is not a typical Assembly of ours, did you create your own class called "Reports"?

Don

valentinakirnishni
Discoverer
0 Kudos

I've created a test project that doesn't have db connection.

IList<Family> mySource = GenerateReportSource();
            string reportName = @"C:\Sandbox\Reports\Reports\MyReport.rpt";
            if (File.Exists(reportName))
            {
                reportDoc = new ReportDocument();
                reportDoc.Load(reportName);
                reportDoc.SetDataSource(mySource);
                CrystalReportViewer1.ReportSource = reportDoc;
                CrystalReportViewer1.DataBind();
            }

It works when the app pool Enable 32-bit applications set to true.

But if it's set to false it throws an exception:"Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{98CDE168-C1BF-4179-BE4C-F2CFA7CB8398}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."