2017-09-21 140 views
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%\">" 
 
    
 
    
 
?>

任何人都可以提出建议?提前致谢!

回答

0

更新行数7,

$crapp = $ObjectFactory-> CreateObject("CrystalDesignRunTime.Application") ; 
+0

嗨娜迦。是的,如果我更新第8行会出现另一个错误,如致命错误:调用未定义的方法com :: CreateObject()在C:\ xampp \ ..... – 1o13

相关问题