i have the following code in my php script. it's for displaying a Crystal Report file.

$cr = new COM( "crystalruntime.application" );
    if ( $cr ) {
        $cr->OpenReport( "SelectExpert1.rpt", 1 );
    } 

if i try to access the file with this code on my browser i get the following error.

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Crystal Reports ActiveX Designer<br/><b>Description:</b> File not found. Details: error' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\idtest.php:5 Stack trace: #0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\idtest.php(5): com->OpenReport('SelectExpert1.r...', 1) #1 {main} thrown in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\idtest.php on line 5

what could be the solution to this error?

File not found.

Check your report path.

Member Avatar for diafol

Clue: File not found
Where in the code the exception was thrown:

C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\idtest.php on line 5

My crystal ball can't peek into your code from here.

i have corrected the mistake but the report is not being displayed

Member Avatar for diafol

Does this require Internet Explorer (thinking of COM) or does it work with all browsers?

it's supposed to work will all browsers but it's not

Member Avatar for diafol

I thought COM utilising ActiveX was IE only. I may be wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.