cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal VCL Error:997 (occasional)

Former Member
0 Kudos

Hello,

I use Crystal Reports XI to make printouts. In Borland C++ Builder 6.0 Professional UP4 I wrote a Windows Service which uses Crystal Reports VCL componnent (distributed with ) to proceed printing. In very short words the service works as follows: it loads a *.rpt file, then supplies rpt's parameters, configures printer and executes CrPe->Print() method. The OS is Windows 2003 Server.

The service described above prints c.a. 1000 labels / printouts a day. The point is that from time to time (in 5-10, sometimes 15 day long, variable length intervals) the engine crashes throwing exceptions executing CrPe->Print(); an enigmatic exception message says that: "Error:997 Failed to Retrieve Error Message from Print Engine". What is important when I restart the service (and CrPe control in it), it starts to work properly, till the next crash in a few days...

The same report supplied with the same data, printed on the same printer using Crystal Reports Developer (for example) is printed correctly and doesn't throw any exceptions / messages.

Sometimes it throws also 513 and 500 printing engine errors but I am not sure if it essential here.

I have some enviroments where the service is running, printing similar counts of labels a day, but the problems appear only in the Windows 2003 Server SP2 one. I really can't point out any external factors making my service to fail. No automatic updates, no antiviruses. LAN (there are network printers in it) works O.K.

Generaly, it is very hard to reproduce this error by tests. Needless to say it is very hard to debug it. So I would appreciate any information on this strange behaviour which could lead me to resolve it.

Thanks in advance,

Piotr.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Piotr,

I'm not fluent in VCL, so I'm not sure what is happening exactly. I do recognize the error message numbers though, and they seem like they might be related to what you're describing.

- error 513 is an "Invalid Printer" error message

- error 500 is a "Not Enough Memory" error message

Since the code works most of the time, and it's only failing on a machine that has Windows 2003 Server with SP2 this suggests an issue related to this OS and Service Pack specifically. Tools like FileMon from Microsoft's Sysinternals Suite may be able to help narrow down what's happening exactly. The [Modules utility|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] might also be able to help rule out a specific DLL issue when you compare the erroring machine to a working machine. You may want to focus on Operating System file differences.

Since the error is hard to duplicate the other error messages (513 or 500) may point to possible causes. If the memory isn't being released or otherwise cleaned up then the application may fail as you're describing. If the printer can't be found occasionally (e.g. a network connectivity issue) then this may contribute to the crashing as well.

Some things to keep in mind:

Crystal Reports, and the various runtime components have never been considered to be batch processing tools. The runtime development components (e.g. VCL, RDC, etc) are not intended to support the kind of load necessary to produce large batch outputs.

The VCL has had no new functionality added, or seen much more than basic maintenance since Crystal Reports 8.5. The VCL is a deprecated API and is no longer being worked on by Business Objects. There's quite a long forum thread on this at [|]. There will be no more releases or further updates of this control.

Since you indicate that your application works well on other machines that don't have Windows Server 2003 with SP2 I'd focus on the differences here to see you can determine what's different with this OS compared to the others.

Sincerely,

Dan Kelleher

Answers (0)