Jump to content

Opening Crystal Reports in PHP site?


geeknout

Recommended Posts

Hey Guys/Gals,

 

I have been searching for a week now all over the web on how to possibly get cyrstal reports to open in php.  I have been close a couple of times, but nothing definative.  Its hard to believe that nobody has done this, there has to be an effective way.  Any thoughts out there?  Has anyone here done that?

Link to comment
https://forums.phpfreaks.com/topic/244950-opening-crystal-reports-in-php-site/
Share on other sites

Just to give someone an idea, this one almost worked... meaning it seems like it reads the file, but never displays it. Of course I have to be able to pass information to Crystal

 

$COM_Object = "CrystalRuntime.Application.8.5";
$my_report = "C:\\filename.rpt";
$my_pdf = "C:\\filename.pdf";

$crapp= New COM($COM_Object) or die("Unable to Create Object");
$creport = $crapp->OpenReport($my_report, 1);
$creport->ReadRecords(); // attention!

$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->PDFExportAllPages=true;
$creport->ExportOptions->DestinationType=1; // Export to File
$creport->ExportOptions->FormatType=31; // Type: PDF
$creport->Export(false); 

//------ Release the variables ------
$creport = null;
$crapp = null;
$ObjectFactory = null

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.