cancel
Showing results for 
Search instead for 
Did you mean: 

Php calling Crystal report 2008 (v12)

Former Member
0 Kudos

Hello,

I found very old posts about this subject and given solutions are not working in my case.

Pc with Crystal report 2008 / Php 5.4.16 / Win 7 x32

I'm running Php in command line (script)

I want call crystal report to generate pdf file using COM object in my php script

The error comes with the message => Fatal error: Call to undefined method variant::OpenReport()

What's wrong with my script ?

Should it work (Php+Crystal) ?

$etat="C:\\Users\\test\\Documents\\testCrystal.rpt";

  try 

  { 

     $ObjectFactory = new COM ( 'CrystalReports12.ObjectFactory.1' ); 

  } 

  catch ( exception $e ) 

  { 

     echo 'caught exception: ' . $e->getMessage () . ', error trace: ' . $e->getTraceAsString (); 

  }

  $crapp = $ObjectFactory->CreateObject("CrystalReports12.ObjectFactory.1");

  $creport = $crapp->OpenReport($etat, 1);

any idea ?

Sincerly

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Franck

I am not sure where you found the solution for CR 2008, but it was contravening the CR 2008 development licensing as it was using the COM SDK. That SDK was based on craxxdrt.dll, which was retired in version 11.5 of Crystal Reports. With CR 2008, you can find a similar file, namely craxddrt.dll, but you are not licensed to use it in development (it is there for internal reasons only). Additionally, if you do decide to go with craxddrt.dll anyhow, you will not be able to deploy the app as there is no CR 2008 COM runtime released (e.g.; no msm / msi).

The only licensed and supported SDKs are the SDK for .NET and Eclipse.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Former Member
0 Kudos

Finally, what could be the solution to execute a report by scripting to generate a pdf file for a single local use ?

I prefer scripting it in php (no web but command line)

This need is quite new for me and I don't know how to go further on.

Thanks

former_member183750
Active Contributor
0 Kudos

Unfortunately, there is no scripting that I know of that will work in php (no CR SDK for that). As I mentioned, you will need to find development software that either supports the .NET Framework, or Java.

- Ludek

Answers (0)