[PHP] Crystal Reports in PHP via COM - SelectPrinter problem

2003-03-27 Thread Andrew Powell
I am receiving an error when attempting to use the SelectPrinter method 
in the CrystalDesignRunTime.Application COM object.  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:|
Warning:  (null)(): Invoke() failed: Exception occurred.
Source: Crystal Reports ActiveX Designer Description:
Error starting print job. Please check your printer or network 
connection. in
d:\athermal\temp\test.php on line 7
-
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.)

I am in the process of converting an Intranet application from CGI4VB to 
PHP.  Some of the scripts call Crystal Reports RDC to print to either 
PDF or their printer, which is mapped through the network on the server. 
I therefore need to call the SelectPrinter method.  Any workarounds or 
patches for this would be very helpful.

aap

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Andrew Powell
Tom:

The install.txt file that came with PHP 4.3.1 states:

   At this time, support for Apache 2 is experimental.  It's
   highly recommended you use PHP with Apache 1.3.x and not
   Apache 2.
aap

Tom Tsongas wrote:

> I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
> previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
> PHP website that I had been developing on for some time.
> After I upgraded, the entire website is virtually non-functional. I
> keep receiving 'Page cannot Display' or 'Document contains no data'
> errors.
>
> I am not sure if this is a configuration issue on Apache or PHP.
> phpinfo seems to work fine and I don't encounter issues accessing pure
> HTML pages directly. Just the PHP ones?
>
> Any ideas folks?
>
> - Tom
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Grid edit form

2003-03-28 Thread Andrew Powell
For the form:

for ($i=0;$i<=59;$i++) {
 echo "";
}

For the post back:

for ($i=0;$i<=59;$i++) {
 $somedata[$i] = $_REQUEST['myfield_'.$i];
}
aap

Daniel Harik wrote:

Hello guys,

I'm trying to make grid form that will allow to edit 60 rows at the same 
time, it's not hard to make a loop that would go from 0 to 59, but  
my problem is that i don't know what rows to update as i see no way to find 
row's id after form is submitted.

Thank You Very much.

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Grid edit form

2003-03-28 Thread Andrew Powell
Then append the id to the input name.

e.g. For the input form:

while (odbc_fetch_row($rs)) {
 echo "";
}

And to read the data:

while (odbc_fetch_row($rs)) {
 $sql = "update MyTable set 
MyFieldValue='".$_REQUEST['myfield_'.odbc_result($rs, "ID")]."' where 
(ID=".odbc_result($rs, "ID").")";
 odbc_exec($db, $sql);
}

aap

Daniel Harik wrote:

Jim Lucas wrote:

 

This is untested, but I seem to recall doing something like this on a
project last year.





















   

Thank you for your reply, but i'm pulling records from db, and
ids won't be 1,2,3,4..n, but more random.
 




Re: [PHP] Crystal Reports in PHP via COM - SelectPrinter problem

2003-03-31 Thread Andrew Powell
Crystal Decisions provided a resolution to the problem.  If the 
SelectPrinter method is called, the PaperOrientation method must also be 
set.

So, to access Crystal Reports from PHP, the following code is used:

$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);

aap

Andrew Powell wrote:

I am receiving an error when attempting to use the SelectPrinter 
method in the CrystalDesignRunTime.Application COM object.  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:|
Warning:  (null)(): Invoke() failed: Exception occurred.
Source: Crystal Reports ActiveX Designer Description:
Error starting print job. Please check your printer or network 
connection. in
d:\athermal\temp\test.php on line 7
-
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.)

I am in the process of converting an Intranet application from CGI4VB 
to PHP.  Some of the scripts call Crystal Reports RDC to print to 
either PDF or their printer, which is mapped through the network on 
the server. I therefore need to call the SelectPrinter method.  Any 
workarounds or patches for this would be very helpful.

aap




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php