Trying to deploy Crystal Report to PHP, but facing some error as below:
Parse error: syntax error, unexpected '$creport' (T_VARIABLE) in C:\xampp....
Using XAMPP localhost, MYSQL and PHP.
Here is the code:
<?php
$my_report = "C:\\feeder_record.rpt"; //
$my_pdf = "C:\\report.pdf";
$ObjectFactory= new COM("{00020906-0000-0000-C000-000000000046}") or die ("Error on load");
($crapp = $ObjectFactory-> CreateObject("CrystalDesignRunTime.Application") )
$creport = $crapp->OpenReport($my_report, "1");
$creport->Database->Tables(1)->SetLogOnInfo("localhost", "root", "", "record");
$creport->EnableParameterPrompting = 0;
$creport->DiscardSavedData;
$creport->ReadRecords();
$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->PDFExportAllPages=true;
$creport->ExportOptions->DestinationType=1;
$creport->ExportOptions->FormatType=31;
$creport->Export(false);
$creport = null;
$crapp = null;
$ObjectFactory = null;
print "<embed src=\"report.pdf\" width=\"100%\" height=\"100%\">"
?>
Anyone can advise? Thanks in advance!