cancel
Showing results for 
Search instead for 
Did you mean: 

ASP.NET Crystal Reports Viewer Error.

Former Member
0 Kudos

Hi Support \ Community

I have an issue that is presenting it self on my production server. When I try to load my report on a page with CRViewer I get the below message on the page with the viewer. I installed both Redist for x86 & x64 bit. But keep receiving the same issue. Thanks for your help in advance.

Let me know if you need any other info to help me resolve this issue.

Page Error:

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

-


System Event Log : System is Windows 2008 web server with SP2 and 64bit.

Log Name: Application

Source: ASP.NET 2.0.50727.0

Date: 10/25/2009 11:04:05 PM

Event ID: 1334

Task Category: None

Level: Error

Keywords: Classic

User: N/A

Computer: u15356492

Description:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/26579/ROOT

Process ID: 3504

Exception: System.TypeInitializationException

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

StackTrace: at CrystalDecisions.CrystalReports.Engine.ReportDocument.Finalize()

InnerException: System.UnauthorizedAccessException

Message: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.

StackTrace: at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()

Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

<System>

<Provider Name="ASP.NET 2.0.50727.0" />

<EventID Qualifiers="49152">1334</EventID>

<Level>2</Level>

<Task>0</Task>

<Keywords>0x80000000000000</Keywords>

<TimeCreated SystemTime="2009-10-26T05:04:05.000Z" />

<EventRecordID>5041</EventRecordID>

<Channel>Application</Channel>

<Computer>u15356492</Computer>

<Security />

</System>

<EventData>

<Data>An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/26579/ROOT

Process ID: 3504

Exception: System.TypeInitializationException

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

StackTrace: at CrystalDecisions.CrystalReports.Engine.ReportDocument.Finalize()

InnerException: System.UnauthorizedAccessException

Message: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.

StackTrace: at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()</Data>

</EventData>

</Event>

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

What is the version of the CR assembly crystaldecisions.crystalreports.engine.dll referenced in your project?

Ludek

Former Member
0 Kudos

My Web.Config file shows 10.5.3700.0

And the Windows\Assemplies I show two files versions 10.0.33.00 & 10.5.3700.0

Let me know if you need anything else.

former_member183750
Active Contributor
0 Kudos

OK. So you are using .NET 2008. Please confirm that you distribute the runtime with these msi files:

CRRedist2008_x86.msi

CRRedist2008_x64.msi

not

CRRedist2005_X64.msi (64 bit Intel)

CRRedist2005_x86.msi (BootStrapper)

Ludek

Former Member
0 Kudos

I installed the 2008 versions.

former_member183750
Active Contributor
0 Kudos

See if the web application directory is configured for the correct framework. E.g.; not 1.1.

If that does not help, download Process Monitor from here:

http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx

Filter it for your process and save the log once you get he error. Then search for any errors like Access Denied, File no Found, etc.

Ludek

Former Member
0 Kudos

Hi Ludek,

I have attached the csv file with what I found. see if you find anything please. I'm also reviwing my self....

Here is a link to my msn skydrive hope you can download.

http://cid-c4634436ac888e03.skydrive.live.com/self.aspx/.Public/CrystalReports/CRIssue.CSV

former_member183750
Active Contributor
0 Kudos

Hi Edgar. Love the idea of sharing the csv as you did. One day, it may even be possible to attach these in here directly. But that is another story...

I looked at the file and the following is interesting;

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll ACCESS DENIED

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll ACCESS DENIED

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll FAST IO DISALLOWED

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll ACCESS DENIED

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll ACCESS DENIED

C:\Program Files (x86)\Business Objects\Common\2.8\bin\sacommlayer.dll ACCESS DENIED

See line 13436 +

The app should be accessing a whole slew of files from that folder, but appears to just quit trying after not being able to access the sacommlayer.dll. I am not sure what's up with that, but see if giving the process rights to the folder will help.

Other than that, we'll have to continue next week as I'm outta here.

Have a great weekend,

Ludek

Former Member
0 Kudos

Hi Ludek,

I was able to fix the original message (with your help of couse.) by adding the IIS credentials to that folder but now I'm receiving the LOAD REPORT FAILED error. Here are some of the stuff I have done already to try to fix the issue.

1. I double check and did see that when I try to run the reports on the webapp the engine creates files in the C:\Windows\Temp folder but anyways I added IIS credentials like I did in the Program Files (x86) folder. I did noticed that they are not cleared or disapear once the web app is closed. Not sure if this is how it should work or because of the error message the process is not cleaning up correctly.

Also

2. I did a reinstall of the x86 redistributable. I have not tried yet for 64 bit redist but will try and update if this fixes anything.

Hope this info help you. I reviewed the Event Log and also tried the process monitor and did not see anything but let me know what you need so I can get it for you.

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

I think you are on the right track re the permissions. You do need read write permissions on the temp folder. Right now, it looks like the read permissions may not be there. E.g.; the process is writing the temp files, but is not able to read them, thus the load report error (the runtime does not use the original report file as such, it only uses the temp files). The fact that these files are not deleted makes sense as the process is terminated before clean up is initiated. It is also possible that there is no delete rights on the folder. Process Monitor should help here again as it will tell you at what point the process is having issues reading the temp rpt. Not sure if the 64 bit runtime will do anything for you. Depends on how the app was compiled - if as 64 bit, you need the 64 bit runtime. If as 32 bit, then 32 bit runtime will do the trick.

Ludek

Former Member
0 Kudos

Hi Ludek,

My webapp was crated using 32bit programming. How can I confirm the read write access also what loging? What do you suggest for troubleshooting approaches to solving this issue.

Former Member
0 Kudos

I will get process monitor again and attach the link so you can review you have better eyes than I do. I will attach in a few, thanks.

Former Member
0 Kudos

Hi Ludek,

Here is the process monitor info. Hope you can find something helpful.

http://cid-c4634436ac888e03.skydrive.live.com/self.aspx/.Public/CrystalReports/Logfile%5E_20091102a....

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

That log looks good. E.g.; nothing to point us to a soution.

What OS is this on and what version of IE?

Ludek

Former Member
0 Kudos

Windows Server Web 2008 (6.0.6002 SP2) 64 bit

IE 8.0.6001.18828

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

Ok. I just want to confirm that both 32 and 64 bit CR runtime is still there? When the app was compiled it was compiled as "Any CPU"?

Can you try to run the app pool of the app as 32 bit?

Ludek

Former Member
0 Kudos

Yes, I used the defaults. Can you provide more details on other changes I'm not sure on request. I know this is in IIS 7 but not sure where do I go?

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

Right click on the Application Pool and select u201CAdvanced Settingsu2026u201D or select the same from the Actions pane after selecting the Application pool

Change the u201CEnable 32-bit Applicationsu201D to True (if you want the application pool to spawn in a 32-bit mode)

Click OK

Below is how you do from the AppCmd:

appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:true

appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:false

NOTE : By default, it is false.

Ludek

Former Member
0 Kudos

Hi Ludek,

Here is what I have tried so far.

1. I did the AppPool you requested and it was already set to 32-bid.

2. I tried changing the working folder from C:\Windows\Temp to D:\Temp via Crystals registry setup (the setup was empty so I added the new location) but it did not take even after I restarted.

I saw that the AppPool settings shows the user IWSP_ etc that the the web app uses, I was thinking of maybing changing to some other that I would think have more rights. What do you think? or what else can I try?

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

Hmm. Does not look like we're getting closer to a resolution. It may be time to obtain phone support from here;

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Or maybe someone else can add their ideas.

Ludek

Former Member
0 Kudos

Hi Ludek,

Sorry I did not reply or ack sooner but was super busy today. On the web I found some guys with similar issues mentioning that the CR engine needs access to some local users local settings folder. Do you know if this is true?

Thanks,

Edgar

Former Member
0 Kudos

Hi Ludek,

I found the problem. But now I have another issue. My developer system is using SQLExpress and my production system the full SQL Server so naming are the similar. I'm trying to figure out how to connect via code or not sure if you have any other ideas? Let me know if you can help and if you need more details about my project.

Thanks,

Edgar

former_member183750
Active Contributor
0 Kudos

You should be able to connect to any other database as long as you are using the same connection type and the database schema matches. The first place to start is in the designer though. Can you change the datasource there? If not, then you will not be able to do it at runtime. if you can change the datasource in the designer, use the code as in the samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples]. Use vbnet_win_dbengine sample app.

Ludek

Former Member
0 Kudos

Hi Ludek,

Thanks for all your help.

FYI for your records the original issues was fixed when I changed the default web site credential to use an alternate that had more rights and my second issue I just changed the code to use the ReportDocument object and then used the setDatabaseLogon property.

thanks again.

Edgar

Answers (0)