cancel
Showing results for 
Search instead for 
Did you mean: 

Type initializer Error

Former Member
0 Kudos

I experience the following error deploying our application to a server.

"The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception"

Development Machine:

Windows 7 x64

Visual Studio 2010

Server (Deployed too):

Windows Server 2008 x64

Application

Basic winforms application

Notes

Set Target CPU in compile options to x86 in VS

Installed CR runtime on the server : CRforVS_redist_install_64bit_13_0_1

References:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.ReportSource.dll

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Shared.dll

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Windows.Forms.dll

Any help much appreciated. Thank you.

Edited by: Reafidy on Jul 21, 2011 8:42 AM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I could be wrong but if your app is 32bit then you should be deploying the 32bit merge modules (not the 64bit merge modules) regardless of the OS you're targeting..

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Fergus,

You were correct, I had installed the incorrect runtime.

Thank you very much for your assistance.

0 Kudos

Excellent - glad to be of help!

Former Member
0 Kudos

Hi Furgus/Reafidy ,

I am was also getting the same error, However I buit the application in anyCPU mode and deployed the 64bit app in a 64bit windows 2008 R2 box I installed crystal report runtime for 64bit which installed the version 13.0 dll's for crystalreport. but I get a wiered error

at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)

at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

at Tesco.Instore.PickingControl.ReportController.PrintDriverDocumentation(String driverDocumentation, Int32 vehicleTripId)]

25/10/2011 14:29:26 PCS Critical Classic .NET AppPool Error running End of Van [Logon failed.

Error in File temp_78d6341f-aa5c-4e12-bd2e-c902339bd793 {C48924CE-77E5-4489-960A-785478ADFD24}.rpt:

Unable to connect: incorrect log on parameters .]

Any clue on that ??

this solution works fine on my dev box windows 7 64bit box..

I am using ADO.Net data set as a report datasource. and also included

<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0"/>

</startup>

in my web config as I am using ADO.Net data source..

Edited by: aditisaha on Oct 25, 2011 3:40 PM

Edited by: aditisaha on Oct 25, 2011 3:41 PM

former_member183750
Active Contributor
0 Kudos

aditisaha, your issue and the one discussed on this thread have nothing in common (other than that you are getting an error). Create a new thread and we'll help you there.

- Ludek

Former Member
0 Kudos

Ok I see, I can certainly give it a try. Im not using the merge modules though, I installed the:

SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)

I presume you are suggesting I try this runtime:

SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)

Thanks for your help.

0 Kudos

Yeah, I meant the MSI (SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)) as you say.

I have Merge Modules on the brain..

0 Kudos

Hey,

Have you tried looking at this article on deploying 32bit apps on 64bit machines?

It makes specific reference to your error..

[http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/10d5fa88-2013-2c10-c9a5-f11963607d4e|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/10d5fa88-2013-2c10-c9a5-f11963607d4e]

Fergus

Former Member
0 Kudos

Hi Fergus,

I hadnt seen that article, I had a good read over it but Im failing to see the connection with my issue. It appears to be a 2009 article as well, we are using visual studio 2010 and the Crystal Reports runtime 13.

What do are you thinking the issue could be?