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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.