Windows의 PHP5에서 Crystal Reports 11 구성 요소에 날짜 매개 변수를 전달하는 데 심각한 문제가 있습니다. 그것은 물론, 쉽게해야하지만, 다양한 주석 처리 된 항목은 작동하지 않습니다전달 날짜 매개 변수 PHP에서 Crystal 보고서
<?php
$my_report = "C:\\xampp\htdocs\wincare\laporan\adm_JumlahPasienPoli.rpt"; // rpt source file
$my_pdf = "C:\\xampp\htdocs\wincare\laporan\adm_JumlahPasienPoli.pdf"; // RPT export to pdf file
//-Create new COM object-depends on your Crystal Report version
$ObjectFactory= new COM("CrystalReports115.ObjectFactory.1") or die ("Error on load"); // call COM port
$crapp = $ObjectFactory-> CreateObject("CrystalDesignRunTime.Application.11"); // create an instance for Crystal
$creport = $crapp->OpenReport($my_report,1); // call rpt report
// to refresh data before
//- Set database logon info - must have
$creport->Database->Tables(1)->SetLogOnInfo("localhost", "db_wincare", "sa", "sa");
//- field prompt or else report will hang - to get through
$creport->EnableParameterPrompting = 0;
// this is the error
$zz = $creport->ParameterFields(1)->SetCurrentValue("2011-01-01 00:00:00");
//export to PDF process
$creport->ExportOptions->DiskFileName=$my_pdf; //export to pdf
$creport->ExportOptions->PDFExportAllPages=true;
$creport->ExportOptions->DestinationType=1; // export to file
$creport->ExportOptions->FormatType=31; // PDF type
$creport->Export(false);
//------ Release the variables ------
$creport = null;
$crapp = null;
$ObjectFactory = null;
//------ Embed the report in the webpage ------
print "<embed src=\"adm_JumlahPasienPoli.pdf\" width=\"100%\" height=\"100%\">"
?>
과 messege : 나는이 질문에 시간이 오래 걸리면 기억
Fatal error: Uncaught exception 'com_exception' with message 'Source:
Description: ' in C:\xampp\htdocs\wincare\laporan\pakai.php:36 Stack trace: #0 C:\xampp\htdocs\wincare\laporan\pakai.php(36): variant->SetCurrentValue('2011-01-01 00:0...') #1 {main} thrown in C:\xampp\htdocs\wincare\laporan\pakai.php on line 36
ㅎ, 오후에 응답 한 후 발견되었습니다. +1 :) (당신이해온 연구를 보여주기 위해 사이트 포인트 스레드를 하이퍼 링크로 연결하고, 그런 것들이 당신을 위해 작동하지 않는다고 말할 수 있습니다.) – halfer
나는 해결책을 제쳐두고 제쳐두고 있습니다. 이미 게시했습니다. 하지만, 가치가있는 데이터는 ** 초 ** 매개 변수입니다. 맞습니까? 첫 번째 매개 변수는'$ creport-> ParameterFields (0)' – halfer
일 가능성이 있습니다 (내 대답에 대한 토론에 따라 최신 OP 편집을 롤백했습니다. 다른 질문을 편집하는 것은 좋은 방법이 아닙니다. 기존 답변이 문맥을 벗어나기 때문에 새로운 질문을하십시오.) – halfer