Solved

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

Posted on 2009-04-04
4
3,209 Views
Last Modified: 2012-05-06
I just began running my development machine off Vista 64bit OS.   I have Crystal Reports XI installed (it's installed in the "Program Files (x86)" folder).  I'm developing in .net 3.5 framework.  Suddenly when i'm trying to run a page that creates a pdf using crystal reports i'm getting the following error:

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

I've tried installing the crystal reports redistributable X64 msi (because all google searches i did for the error message i was getting was telling me to do so) but it won't install.  It gives me the following error:  
"Another version of this product is already installed. installation of this version cannot continue.  to configure or remove the existing version of this product, use Add/Remove programs on the control panel".

I have no idea what to do at this point.  My questions are:

1)  Why am i getting the original error (the one about the type initializer throwing an exception"
2) is installing the redistributable the way to fix it?
3) if so, how do i get it to install
4) if not, what do i need to do to fix this problem

tearing my hair out.  I always seem to run into one problem or another with Crystal Reports.  I need to get this running ASAP so that i can finish the development of this project.

thanks for any help.
0
Comment
Question by:davidcahan
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
mrcoolcoder earned 500 total points
Comment Utility
1)  Why am i getting the original error (the one about the type initializer throwing an exception"

Make sure your web.config has a reference to the Crystal Reports Engine under assemblies.

2) is installing the redistributable the way to fix it?

No, the redistributable is intended for server that will not need the designer.  This is for a production box.

3) if so, how do i get it to install

Only way to install it will be to remove the current installation.

4) if not, what do i need to do to fix this problem

Try downloading all the Service Packs from SAP.  There are so many its confusing but there were several bugs that they fix.  You can find the location to SAP in the help.  Also, there is a strange situation that I encountered one time (I've installed Crystal on 22 production servers and workstations.  I had to grant WRITE access to the Temp folder on my system to the ASP.NET user account and the system account.
0
 
LVL 5

Expert Comment

by:mrcoolcoder
Comment Utility
thanks but what helped you solve your problem?
0
 

Author Comment

by:davidcahan
Comment Utility
actually, this might sound weird, but it wasn't anything specific in your message.  It was the fact that your message influenced me to dig deeper into the problem.  What actually ended up fixing it was grabbing the dll's in C:\Program Files (x86)\Business Objects\Common\2.8\managed and placing them in my Bin folder in the project.
0
 
LVL 5

Expert Comment

by:mrcoolcoder
Comment Utility
Yes, that will work but the way I import assemblies is by the web.config.  Glad I could help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now