Select to view content in your preferred language

Type initializer Error

579
2
08-12-2010 05:49 PM
SeanFairhurst
New Contributor
I have an error condition explained below that I can prevent from happening by first opening an ArcMap dialog box before I run the code.  I can open any Arcmap dialog "File Save...", customize>extensions...  anything in the arcmap menus will prevent this error.  Why? 

I have references to the Crystal Reports 2008 components in an ArcGIS 10 desktop application.  I have one line of VB code that runs from a simple desktop button:

Dim cReport as New CrystalDecisions.CrystalReports.Engine.ReportDocument

it produces the error:

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

This also runs fine if I don't launch it from within ArcGIS.  Does anyone have a clue what might be going on.

-Sean
0 Kudos
2 Replies
HungNguyen4
New Contributor
Hi there, did you have solution to your problem here? I have the same problem and waste almost a week trying the find a solution.
0 Kudos
PatrickKoo
New Contributor
Hi there, did you have solution to your problem here? I have the same problem and waste almost a week trying the find a solution.


I am having the same issue (with an ArcEngine app)... If I try to access a crystal assembly/method (ie. CrystalDecisions.CrystalReports.Engine.ReportDocument.Load()), I get the "Type initializer error" when I try to launch the Engine app.  Same thing vice versa (if I open the ArcEngine app first, I get the "Type initializer error" when I try to launch the crystal reports method.

Note: The exact same code works fine if the app is built against ArcGIS 9.3.1.
0 Kudos