Opening a report with PHP code

Posted on 2006-03-31
Last Modified: 2010-05-18
I would like to know if Crystal Reports can be used with PHP. I have the following PHP code:

$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.
Question by:horalia
    LVL 100

    Accepted Solution


    Author Comment

    This is the only response I have gotten since I opened up the question. I'll go ahead and award the points and close.
    LVL 100

    Expert Comment

    Glad i could help


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now