php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22902 Crystal Reports 9 (RDC) and SelectPrinter error
Submitted: 2003-03-26 09:03 UTC Modified: 2003-03-31 10:24 UTC
From: andy at advancethermal dot com Assigned:
Status: Not a bug Package: COM related
PHP Version: 4.3.1 OS: Windows XP Professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andy at advancethermal dot com
New email:
PHP Version: OS:

 

 [2003-03-26 09:03 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-27 02:48 UTC] phanto@php.net
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-31 10:24 UTC] andy at advancethermal dot com
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);
 [2004-05-11 18:11 UTC] sumuhanj at hotmail dot com
Just wanted to say thank you for everyone on the thread. I had the same problem and it is great to get find the solution. Long live the web
 [2004-05-31 12:19 UTC] ramesh_vetcha at yahoo dot com
Dear All,

I too getting the below error when I try to assign the selected printer name using 'SelectPrinter' method of the report object. Can any one help me on this. Thanks.

Run-time error '-2147467261 (80004003)': Method 'SelectPrinter' of object 'Ireport' failed.

Regards
Ramesh V
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 06:01:28 2024 UTC