0
試圖水晶報表部署到PHP,但面臨着一些錯誤如下:
解析錯誤:語法錯誤,意外'$ creport'(T_VARIABLE)in C:\ xampp ....
使用XAMPP localhost,MYSQL和PHP。
下面是代碼:
<?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%\">"
?>
任何人都可以提出建議?提前致謝!
嗨娜迦。是的,如果我更新第8行會出現另一個錯誤,如致命錯誤:調用未定義的方法com :: CreateObject()在C:\ xampp \ ..... – 1o13