ID: 36959 Comment by: i_geber at hotmail dot com Reported By: djogopatrao at gmail dot com Status: Open Bug Type: COM related Operating System: Windows XP PHP Version: 5.1.2 New Comment:
If I would like to call a report that has parameters, how do I write the syntax? thanks Previous Comments: ------------------------------------------------------------------------ [2006-04-03 15:41:05] djogopatrao at gmail dot com I modified slightly the code (see below, I called it hang.php) Running thru apache2, it hangs. No response from the browser (it's still "loading", started 2h ago). No entries in "error.log" since then. Commenting the $creport->ReadRecords(); line, it works. But when running by PHP CLI C:\>"Arquivos de programas\Apache Group\Apache2\bin\php.exe" hang.php C:\> It runs just fine! --------- hang.php $my_report = 'C:\Arquivos de programas\Apache Group\Apache2\htdocs\webdisc\relatorios\cadastro1.rpt'; $my_pdf = 'c:\18530.pdf'; $ObjectFactory= New COM("CrystalReports115.ObjectFactory.1"); $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application"); $creport = $crapp->OpenReport($my_report, 1); $creport->ReadRecords(); //hangs here, not thru PHPCLI $creport->ExportOptions->DiskFileName=$my_pdf; $creport->ExportOptions->PDFExportAllPages=true; $creport->ExportOptions->DestinationType=1; // Export to File $creport->ExportOptions->FormatType=31; // Type: PDF $creport->Export(false); ------------------------------------------------------------------------ [2006-04-03 14:49:18] [EMAIL PROTECTED] Error log entries related to the problem would be more helpful than just "hangs". Also, you can try to run the same code with PHP CLI and check for any error messages. ------------------------------------------------------------------------ [2006-04-03 14:33:24] djogopatrao at gmail dot com When I say that it hangs, I mean that the browser keeps on loading the page forever, until it gets timeout. More information? I would gladly give an example report file, but as it depends on a database server and ODBC configuration, I don't know how to proceed. Please contact me if is there anything that I can do. dfcp ------------------------------------------------------------------------ [2006-04-03 14:23:03] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Please define "hangs" and add more information if possible. ------------------------------------------------------------------------ [2006-04-03 14:10:35] djogopatrao at gmail dot com Description: ------------ In order to verify this, you need 1) crystal reports XI version 2 (free download for trial at www.businessobjects.com) 2) access to a database 3) a report that uses data from this database the code above hangs when invoking the ReadRecords method. A equivalent code was tested and worked OK under Visual Fox Pro. thanks dfcp Reproduce code: --------------- $my_report = "c:\\report1.rpt"; $my_pdf = "c:\\report1.pdf"; $ObjectFactory= New COM("CrystalReports115.ObjectFactory.1"); $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application"); $creport = $crapp->OpenReport($my_report, 1); $creport->ReadRecords(); //hangs here $creport->ExportOptions->DiskFileName=$my_pdf; $creport->ExportOptions->PDFExportAllPages=true; $creport->ExportOptions->DestinationType=1; // Export to File $creport->ExportOptions->FormatType=31; // Type: PDF $creport->Export(false); Expected result: ---------------- It would create a file (name $my_pdf) with the report. Actual result: -------------- It hangs. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36959&edit=1