Edit report at http://bugs.php.net/bug.php?id=36959&edit=1
ID: 36959
Comment by: girlmauhong85 at yahoo dot com
Reported by: djogopatrao at gmail dot com
Summary: ReadRecords Method (Crystal Reports XI) Hangs
Status: Bogus
Type: Bug
Package: COM related
Operating System: Windows XP
PHP Version: 5.1.2
New Comment:
i work with Crystal Report 10 and i work only onnce time. When i try
again, i get the following error:Fatal error: Uncaught exception
'com_exception' with message '<b>Source:</b> Crystal Reports ActiveX
Designer<br/><b>Description:</b> Unbekannter Abfragemodulfehler' in
C:\xampp\htdocs\neu\BescheinigungPDF.php:28 Stack trace: #0
C:\xampp\htdocs\neu\BescheinigungPDF.php(28):
variant->LogOnServer('p2sifmx', 'name', 'name', 'acc', 'pass') #1
C:\xampp\htdocs\neu\BescheinigungPDF.php(123):
BescheinigungPDF->getPDF('20062', 99898989) #2 {main} thrown in
C:\xampp\htdocs\neu\BescheinigungPDF.php on line 28
my code:
function getPDF($sem,$mtknr){
// Create an Crystal Object Factory.
$o_CrObjectFactory = new
COM('CrystalReports10.ObjectFactory.1')or die ("Error on load");
try {
$o_CrApplication =
$o_CrObjectFactory->CreateObject("CrystalRunTime.Application");
} catch (com_exception $e){
echo("<br>Error on instance
creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString().'</p>');
echo "<p><pre>".print_r($e, true)."</pre></p>";
exit;
}
// Register the typelibrary.
com_load_typelib('CrystalDesignRunTime.Application');
// Load the report.
$o_CrReport =
$o_CrApplication->OpenReport('C:\xampp\apache\Studienbescheinigung.rpt',
1);// 1== crOpenReportByTempCopy.
$o_CrReport->Database->LogOnServer('p2sifmx', 'name', 'name',
'acc', 'pass');
$o_CrReport->DisplayProgressDialog = False;
$s_ExportedReport = 'C:\xampp\apache\test.pdf';
var_dump($o_CrReport->RecordSelectionFormula);
$str = "{sossys.aktsem} = $sem and {sos.mtknr} = $mtknr";
$o_CrReport->RecordSelectionFormula=$str;
var_dump($o_CrReport->RecordSelectionFormula);
// Run the report and save the PDF to disk.
$o_CrReport->ExportOptions->DiskFileName = $s_ExportedReport;
$o_CrReport->ExportOptions->PDFExportAllPages = true;
$o_CrReport->ExportOptions->DestinationType = 1; // Export to
File
$o_CrReport->ExportOptions->FormatType = 31; // 31 = PDF, 36 =
XLS, 14 =DOC
$o_CrReport->EnableParameterPrompting = 0;
$o_CrReport->DiscardSavedData; //remove die saved Datei
$o_CrReport->ReadRecords(); //force it to update the data in the
report from the ADO.command,(Does not work).
$o_CrReport->Export(false);
$o_CrReport=null;
$o_CrApplication = null;
$o_CrObjectFactory=null;
print "...done";
var_dump($o_CrReport->RecordSelectionFormula); /*****/
}
My chef think, i shoul programm in java but every thing i worked with
php(my programm work for an card terminal). Should i make an connection
between php and java to call my crystal report?
Please help me, thank you very much!!!
Previous Comments:
------------------------------------------------------------------------
[2008-11-27 13:21:40] djogopatrao at gmail dot com
Hello
Please refer to my previous comment at 3 Apr 2006, in which I tested the
same code with PHP-CLI and it worked fine, but without any pop-ups. When
generating the report from CR, no pop-ups appeared too. That particular
rpt file had all the connection information.
I also remember that it wasn't related to some connection problem - if
the settings were incorrect, it would throw a exception instead of
hanging.
It was 2 years ago, and I don't know anymore where the bug setup files
are, but if you wish I can spend some time looking for it.
------------------------------------------------------------------------
[2008-11-27 11:22:20] [email protected]
not a bug > bogus
------------------------------------------------------------------------
[2008-11-27 11:06:30] hummerok at gmsil dot com
this is not a bug. probably you have some alerts when you open this
report in designer. all you need - just to update it and thos alert
will gone. another reason: when you set parameters from your program
you need to set $creport->EnableParameterPrompting = 0; - this also
might help. I had problems like this - solved
------------------------------------------------------------------------
[2008-06-06 12:53:00] [email protected]
Most likely this is not a bug. I've just started using Crystal XI with
PHP5. One of the things that happens for me is I get a dialogue asking
to login to the DB being used by the report.
See
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_23463121.html#21728474
------------------------------------------------------------------------
[2007-08-15 08:37:01] [email protected]
Assigned to the maintainer.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=36959
--
Edit this bug report at http://bugs.php.net/bug.php?id=36959&edit=1