cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports COM Error

Former Member
0 Kudos

I have a Crystal Report that I load and run from an ASP.Net Web Application. It works fine on my machine. However when the code is deployed to the servers, intermittently (does not happen everytime), I receive the following exception:

System.IO.FileLoadException: Retrieving the COM class factory for component with CLSID {XXX}  failed due to the following error: 8007045a.
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.CreateRptDoc()
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper..ctor()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Initialize()
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()

When I search for this error I am not able to find the exact cause of the COM error 8007045a or the System.IO.FileLoadException. But many people have encountered other COM Errors with Crystal Reports and have suggested changing the Project properties -> Build -> Platform Target to x86 from 'Any CPU'.

Is this indeed the action to be taken for the COM error 8007045a or the System.IO.FileLoadException too?

One of the folks suggested the following: It is a low-level Windows error, not a COM error. The DllMain() entrypoint of one of the unmanaged code DLLs used by CR returned FALSE.

Any suggestions here?

Thanks in advance

Vikas

Edited by: vikasmanghani on Dec 22, 2011 3:53 PM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Vikas,

That error can be due to multiple issues. Try adding logging to help see what your app is doing. Could be a contiguos memory problem, not closing and disposing of your report objects. Or could be AV/firewall software blocking access for some reason...

Not enough info to go on. You need to do more debugging.

Could even be the Temp space is runnign out of space...

Don

Former Member
0 Kudos

Hi Don

Thanks for the prompt response.

I had a few queries in mind with regards to debugging this error:

1. What kind of logging do you propose? Basically, this error occurs when I try to instantiate the report instance. What i mean here, is that the .rpt file is added to my solution locally and I am trying to instantiate the class that gets created for representing the report.

2. I am disposing off the report instance in a finally block, so that should not be a problem. First I call Close and then Dispose on the report instance.

3. Since the report file is locally hosted, I believe it should not be an AV/Firewall issue. Please correct me if I am wrong on this one.

4. What is meant by "A continguous memory problem" and "Temp space running out". I am not quite clear about these.

Thanks and Regards

Vikas

0 Kudos

Hi Vikas,

Need more info now. What version of CR are you using and any patches?

What OS?

What version of IIS?

MS allocates memory for your app, when CR needs memory it must be in one block, it can't be broken up into various area's.

Don

Former Member
0 Kudos

Hi Don

The CR version is Crystal Reports 2008 SP3.

OS - Windows Server 2003

IIS - IIS 6 (I am not entirely sure, but most likely it is IIS 6).

Does it matter, if I instantiate the ReportDocument derived class on a separate thread. For e.g.

Main Thread:

MyReportClass rpt;
Thread t1 = new Thread(InitRpt);
t1.IsBackground = true;
t1.Start();
//perform some additional work
t1.Join();

Thread t1:

rpt = new MyReportClass();
rpt.FileName = "";
rpt.Load();

Also the BuildAction property for the report is set to Content.

As an aside, I noticed another error on a different server:

System.Runtime.InteropServices.COMException (0x80000003): Retrieving the COM class factory for component with CLSID {D7F5D7C3-B06C-4CAC-BC47-A06E66D2EE9B} failed due to the following error: 80000003.
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.CreateRptDoc()
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper..ctor()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Initialize()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
   at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()

For this COM Error 80000003, I was able to search on SAP forums and locate the following:

1. Some people have asked to re-register clientdoc.dll using regsvr32.

2. Some people have suggested rebooting the server.

3. Some have suggested running in 32-bit mode. I am not sure if this server is 64-bit or 32-bit.

It would be great if you could help me with this one too.

Thanks in advance.

Regards

Vikas

Edited by: vikasmanghani on Dec 24, 2011 4:38 AM

Edited by: vikasmanghani on Dec 24, 2011 4:42 AM

0 Kudos

CR 2008 is 32 bit only so all parts must be run in 32 bit mode including youe AppPool.

Search, there are kbases on how to configure IIS for 32 bit mode

Don

Former Member
0 Kudos

Hi Don

I have checked with the server team and both errors are occurring on 32-bit servers running IIS 6.

Do you think it will be useful to change the Platform target property of the Visual Studio project to 'x86' from 'Any CPU'?

Thanks and Regards

Vikas

Edited by: vikasmanghani on Dec 25, 2011 2:16 PM

Edited by: vikasmanghani on Dec 25, 2011 2:21 PM

0 Kudos

Yes, CR 2008 is 32 bit only so you have to run everything in 32 bit mode...

Don

Answers (0)