note 63228 deleted from ref.com by danbrown
| From: | danbrown@php.net | Date: | Mon, 21 Dec 2009 17:06:25 +0000 |
| Subject: | note 63228 deleted from ref.com by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164199@lists.php.net to get a copy of this message | ||
Note Submitter: djogopatrao at gmail dot com
----
This function converts the crystal report in file $my_report to a PDF file $my_pdf. Exceptions may
raise, so put it in a try..catch block.
I struggled so hard to get this done... any comments, please contact me.
function exportCrystalReportToPDF( $my_report, $my_pdf )
{
// by dfcp/mar/06
$ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
$creport = $crapp->OpenReport($my_report, 1);
$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);
}