Skip to Content
author's profile photo Former Member
Former Member

One possible reason to why ReportDocument.Load() hangs

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]

-


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 19, 2011 at 04:34 PM

    Good morning Mike

    Many thanks for sharing your findings with the community. Very neat findings that will hopefully save someone else a lot of time as this must have been pretty hard to figure out.

    To touch on the printer driver issue. You are absolutely correct in that the report engine will try to load a printer driver as it uses the driver to render the reports. Now, in CR XI R2 there is a "No Printer" option. As I understand it, enabling this option forces the engine to use it's own algorithm to render the report (why that is not be default...). Anyhow, just putting it out there as it may be something to try if you do not want to, or are not able to install a printer driver on that box.

    Have a great day,

    Ludek

    Follow us on Twitter http://twitter.com/SAPCRNetSup

    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2011 at 05:00 PM

    Good morning to you (even though the work day is already about to finish here in Europe) 😊

    Yes, as a matter of fact I did find the "No printer" option and I thought it might be related to this issue. However, I have not been able to try if it does the trick, since I have already accepted the driver to be downloaded (and I cannot revert to the previous state). But it would definitely be a good thing to try for someone who experience the same problem.

    /Mikael

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      In some report testing I installed the driver as well. Does anyone know of a way to revert or uninstall that driver so that I can again see when I have reports that would display the "Do you trust the printer" message?

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.