Skip to Content
avatar image
Former Member

Crystal Reports - Intermittent printer spool stop using SDK

We’re using Visual Studio 2013 to build a 32-bit DLL to print and preview crystal reports which are designed in-house. This DLL is then called by our main software. The latest DLL is built using SAP Crystal Runtime SP20, 32-bit with the ‘CrystalDecisions.ReportAppServer’ assembly. We load the report using ‘CrystalDecisions.CrystalReports.Engine.ReportDocument’ set parameters, change the report and sub reports database and table locations and then send to a printer, using the ‘PrintOutputController.PrintReport(PrintOptions)’ command.

Intermittently, on the customer environment, we see a stop in printing on the above ‘PrintReport()’ call. The main software sees a pause while waiting for our DLL. It appears, via logs, that the DLL is waiting for PrintReport() response, which never returns. In the print queue, we can see the document waiting and other reports queuing behind. The only way to recover, is to stop that particular print document or to force close the main software entirely. This has also been reported by other customers, with different reports and printers. Different drivers have been installed locally and on a network. Different operating systems have been tried including Windows 10.1. All raise the same error. Development machine: Windows 7 64-bit, .Net 4.5, Visual Studio 2013. Target Client machines: Windows 7 and 8, .Net 4.5.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 11, 2017 at 03:29 PM

    Hi Simon,

    I hear this often so I searched on how to get printer job status reports from the Printer service and found this great article from Microsoft:

    Add/create an app that can query the Printers and see what the problem is, it could be an issue with the driver, the framework or memory etc.

    Sending off large print jobs to the Printer that is not capable of holding that much info in it's memory can cause issues like yours.

    CR simple streams the job to the printer, once it's completed though it does wait for a response from the printer the job is complete, if it does not reply then the app will appear to hang.

    So it would be interesting to know what error is actually being generated by the spooler.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Don Williams

      Hi Don,

      The end user has little control on the makeup and input of the report. We simply pass in one or two parameters.

      The end users have, in the past, had waits for over an hour, at which time they force close the application.These prints normally takes a few seconds. We know something is wrong when we don't get a response after around a minute.

      I'll put the PDF idea forward.

      We already have extensive logging and error catching. We have found this issue on a number of reports and users. But it does happen mainly on a few reports on a few machines. These tend to be of high volume.

      Thank you for you help.


  • Aug 31, 2017 at 08:45 PM

    Hi Simon,

    If it's not consistent then it is environment on those users PC or something they are doing differently maybe.

    Do they have the Printers installed?

    Updated runtime? CR had a bug in older versions that the report engine would look for the exact printer used when designed. We fixed that and added Dissociate to the page setup properties.

    If they are using Terminal Server to connect that is another bug MS introduced, install the printers locally and don't use the Redirected 2 drivers.

    Could be AV software also, look in their logs for anything.

    Also look in the event viewer to see if anything is logged.

    I haven't seen this myself so I can't suggest anything else....

    Maybe Modules or ProcessMonitor logs and compare good/bad logs, same report, same time.

    Is this a Server app you wrote? If it is how many report jobs are being executed at one time?

    CR for VS was never designer for high load situations, it's all inProc and never designed to do that.

    How many reports are being processed at one time?


    Add comment
    10|10000 characters needed characters exceeded