Printing problem - the job disapears from the spooler
Posted on 2003-11-01
OS: Windows XP
Programming language: Delphi 4 + service packs
VCL component version: 184.108.40.206, VCL for Delphi 4
Crystal Reports: Development Edition 220.127.116.11
The program has to print a crystal report without user intervention to a nominated printer in the program's options. This is part of a automated process and it should just print the report and move on.
I have currently installed 3local printers: Genreric Text ,Panasonic KX-P6100 , dummy printer that prints to a file
Depending on wich is my default printer and which printer is set up in the program's option I get the strage situation when the report is sent to the spooler, it sits there for a half of second saying "Spooling" and that it disapears. There are no errros and no messages. This happens when I tell the report on which printer to print.
If I bring up the printer selection dialog and select the printer than it work juts fine.
Here is the calling code for the crystal report that I am using:
Oderreport: TCrpe; - this is the static Crystal Report component on the form
OrdersReport.ReportName := 'name of the report file.rpt' ;
//Set database location
OrdersReport.Tables.Path := SysControl.DataDirectory;
OrdersReport.Tables.Propagate := True;
OrdersReport.output := toPrinter;
OrdersReport.Printer.Name := SysControl.PrinterName;
OrdersReport.Printer.ShowDialog := False;
SysControl.PrinterName is pick-up up from the options of the program and it's the name of a windows printer as in Printer.Printers wich returns the third printer in the windows printer list.
If I change in the code above only
OrdersReport.Printer.ShowDialog := True;
and I hit the OK button on the Printer Dialog that appears it will print the report without problems.
Does anyone ever had or encoutered this problem ?
Thank you for your help.