Link to home
Start Free TrialLog in
Avatar of Lia Nungaray
Lia NungarayFlag for United States of America

asked on

Opening a report with PHP code

I would like to know if Crystal Reports can be used with PHP. I have the following PHP code:

<?php
$reportToRun="C:\Program Files\EasyPHP1-8\www\trout\MyCustomer.rpt";
$crapp = new COM("CrystalRuntime.Application.10");
$creport = $crapp->OpenReport($reportToRun, 1);
?>

I get the following error:

Fatal error: Uncaught exception 'com_exception' with message 'Source: Crystal Reports ActiveX Designer
Description: Invalid directory.' in C:\Program Files\xampp\htdocs\xampp\crystal1.php:4 Stack trace: #0 C:\Program Files\xampp\htdocs\xampp\crystal1.php(4): com->OpenReport('C:\Program File...', 1) #1 {main} thrown in C:\Program Files\xampp\htdocs\xampp\crystal1.php on line 4

If I comment out the fourth line, where the report is being opened, I get no error message. My ultimate goal is to pass parameters to Crystal Reports, and have the user run the report from a web page. I am using Crystal Reports 10, Professional version. If this task is too much of a pain to accomplish using PHP, I am open to other technologies. Any suggestions will be appreciated. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lia Nungaray

ASKER

This is the only response I have gotten since I opened up the question. I'll go ahead and award the points and close.
Avatar of Mike McCracken
Mike McCracken

Glad i could help

mlmcc