ID: 22902 User updated by: andy at advancethermal dot com Reported By: andy at advancethermal dot com Status: Bogus Bug Type: COM related Operating System: Windows XP Professional PHP Version: 4.3.1 New Comment:
Crystal Decisions provided a resolution to the problem. The PaperOrientation method must be specified if the SelectPrinter method is used. Here is the code that works. $crapp = new COM("CrystalDesignRunTime.Application"); $creport = $crapp->OpenReport("d:\\athermal\\reports\\backlog.rpt", 1); $creport->SelectPrinter("winspool", "HP LaserJet 1200 Series PCL", "Ne01:"); $creport->PaperOrientation = 0; $creport->PrintOut(False); Previous Comments: ------------------------------------------------------------------------ [2003-03-27 02:48:12] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. that's not a php issue ------------------------------------------------------------------------ [2003-03-26 09:03:47] andy at advancethermal dot com Specifying a printer from the SelectPrinter method causes PHP to crash. The following code: ----- $crapp = new COM("CrystalDesignRunTime.Application"); $creport = $crapp->OpenReport("d:\\athermal\\reports\\backlog.rpt", 1); $creport->SelectPrinter("winspool", "HP LaserJet 1200 Series PCL", "Ne01:"); print "DEBUG|".$creport->DriverName."|".$creport->PrinterName."|".$creport->PortName."|"; $creport->PrintOut(False); ----- Produces the following output: ----- Content-type: text/html X-Powered-By: PHP/4.3.1 winspool|HP LaserJet 1200 Series PCL|Ne01:|<br /> <b>Warning</b>: (null)(): Invoke() failed: Exception occurred. <b>Source</b>: Crystal Reports ActiveX Designer <b>Description</b>: Error start ing print job. Please check your printer or network connection. in <b>d:\atherma l\temp\test.php</b> on line <b>7</b><br /> ----- Other items to note: - When the SelectPrinter line is commented out, the report prints fine to the default printer and the DEBUG line prints "DEBUG|||". - If the PrintOut line is commented out, the DEBUG line prints "DEBUG|winspool|HP LaserJet 1200 Series PCL|Ne01:|" without any error. - If the PortName is not specified, or specified incorrectly on the SelectPrinter line, it is printed correctly on the DEBUG line. (i.e. if "Ne00:" is specified on the SelectPrinter line, "Ne01:" is reported on the DEBUG line.) aap ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22902&edit=1