Wednesday 15 July 2009

The type initializer for 'crystaldecisions.crystalreports.engine.reportdocument' threw an exception - Resolved

Today I got this error, when I tried to deploy an application developed using Visual Studio 2005 and Crystal Reports 10.

I googled the problem and found out many solutions which worked for many people. But only one solution worked for me. Anyway I will post all the things that I have tried.


Solution #1

Run ‘CRRedist2005_x86.msi’. This file can be found on ‘C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports’. And if you have already installed this you will be prompted to Repair or Uninstall. But none is required if it’s already installed.

Solution #2

Uninstall the Crystal Reports for Visual Studio 2005 using the Visual Studio Instalation DVD and Reinstall it again.

Steps to uninstall the Crystal Reports for Visual Studio 2005

  1. Insert the Setup DVD

  2. Select ‘Change or Remove Visual Studio 2005’ (Then the setup will run on Maintenance Mode)

  3. Select ‘Add or Remove Features’

  4. Uncheck the ‘Crystal Reports For Visual Studio’ checkbox

  5. Click on ‘Update’ button

  6. Afterwards do the above steps and on step 4 select the ‘Crystal Reports For Visual Studio’ checkbox and click on ‘Update’ button


Solution #3

Create a setup using the Crystal Reports Merge Module, It can be downloaded from http://support.businessobjects.com/downloads/merge_modules.asp. And run it on the deployment machine


Solution #3 worked for me..

Hope this will be helpful to you …………