Skip to Content
0
Former Member
Jan 19, 2011 at 04:25 PM

One possible reason to why ReportDocument.Load() hangs

293 Views

Server: Windows Server 2008, 64-bit

Crystal Reports: Crystal Reports Runtime Package 3.3

This post is not a question but a summary of a problem I had. Maybe someone out there will find the information interesting.

The problem I had was that a web service that is used to render an rpt file to a pdf file using the crystal report runtime component constantly hanged on the ReportDocument.Load() method.

Searching through this forum I found some interesting threads pointing at that the number of concurrent processing licenses (CPL) might be a reason ([this article|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/804acc00-8364-2b10-b995-de99ca43c403?QuickLink=index&overridelayout=true] was helpful to undestand this issue). It turned out that it was the problem (GetConcurrentUsage() returned 4). But just a part of the problem. In my scenario these licenses should not run out since I only process one report at the time. Now, it turned out that there was another reason for the method to hang, and after having to abort the thread a couple of times, well then the available licenses had been consumed.

So, now to the root cause. It turned out that the Load method of the ReportDocument instance needed to access a printer. Exactly why I don't know. I found this out when I wrapped my code into a console application instead and ran that one on the server. The difference turned out to be that running the code as a console application led to that I was prompted specifically if I allowed a printer driver to be installed (see exact text below). After having accepted, everyting works. Both the console application and the web service.

/Mikael

The following was promted to me:

-


Do you trust this printer?

Windows needs to download and install a software driver from the [...] computer to print to [...]. Proceed only if you trust the [...] computer and the network. For more information about installing drivers, see Help and Support.

Buttons: [Install driver] [Cancel]

-