<?php
$my_report = "D:\\wamp64\www\\report\\test.rpt";
$my_pdf = "D:\\wamp64\www\\report\\test.pdf";
$o_CrObjectFactory = new COM('CrystalReports115.ObjectFactory.1');
$o_CrApplication =$o_CrObjectFactory->CreateObject("CrystalDesignRunTime.Application");
$creport = $o_CrApplication->OpenReport($my_report, 1);
$o_CrApplication->LogOnServer('localhost','grn','root','');
$creport->RecordSelectionFormula="{parameter.id}='1'";
//------ This is very important. DiscardSavedData make a
// Refresh in your data -------
$creport->DiscardSavedData;
//------ Read the records :-P -------
$creport->ReadRecords();
//------ Export to PDF -------
$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->FormatType=31;
$creport->ExportOptions->DestinationType=1;
$creport->Export(false);
//------ Release the variables
$creport = null;
$crapp = null;
$ObjectFactory = null;
?>
我正在尝试通过水晶报告在输出pdf报告的代码下运行php mysql,但发生了致命错误。 [错误图片] [1]请帮帮我。我使用PHP 5.6.31水晶报告11.5.10.1263。