Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Php calling Crystal report 2008 (v12)

$
0
0

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


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>