Crystal Reports 8.5 VCL - Printing Multiple Reports
Posted on 2004-04-10
I am having trouble printing a report with the TCrpe VCL object.
I am using Borland C++ Builder 5, Crystal Reports 8.5, and crpe32.dll is version 220.127.116.11.
I set the Output property of the TCrpe object to toPrinter and call Execute( ). This prints fine the first time, but if I try to print a second time nothing happens. I get no errors and every status property I can find indicates that the report printed sucessfully. The only way I can get the program to print again is to restart the program. I can always print only once. However, if I set Output=toWindow, I can print normally from the preview screen.
Every time the report unsuccessfully tries to print, the report appears in the Printer's Job Queue for an instant and then after no more than a couple seconds disappears without printing. This same behavior occurs on all Windows operating systems and printers that I have tried. It also doesn't matter if it is a local or network printer.
Is this a bug in the print engine that has been fixed with an updated version of crpe32.dll?
Is something in the TCrpe object somehow destroying the print job before it is printed?
Here is the code:
ReportCrpe->ReportName = reportFilename;
ReportCrpe->Output = toPrinter;
ReportCrpe->Printer->Name = printerName;
ReportCrpe->PrintOptions->Copies = 1;
ReportCrpe->PrintOptions->Collation = Collated;