Hi All,
We are tyring to call crystal reports in web page using php code, and I am newbie to php so if any one can give some direction as to how to achieve this would be of great help.
Thanks,
-Narain.
narainmajji (BOB member since 2006-04-27)
Hi All,
We are tyring to call crystal reports in web page using php code, and I am newbie to php so if any one can give some direction as to how to achieve this would be of great help.
Thanks,
-Narain.
narainmajji (BOB member since 2006-04-27)
Just to add.,
this is the php code i am using:
<?php $oApp = new COM ("CrystalRuntime.Application.10"); $oRpt = $oApp->OpenReport(realpath("filename.rpt")); $oRpt->MorePrintEngineErrorMessages = 0; $oRpt->EnableParameterPrompting = 0; $oRpt->RecordSelectionFormula = "{EMPLOYEE.NAME} < 'C'"; $oRpt->PrintOut(false); // tried also with $oRpt->PrintOut(0) but i get an exception ?>and this is the error i am getting
Fatal error: Uncaught exception ‘com_exception’ with message
‘Failed to create COM object `CrystalRuntime.Application’: Invalid syntax
’ in C:\PhpDev\RunCrystalREportPhp.php:3 Stack trace: #0 C:\PhpDev\RunCrystalREportPhp.php(3): com->com(‘CrystalRuntime…’) #1
{main} thrown in C:\PhpDev\RunCrystalREportPhp.php on line 3
Thanks,
-Narain.
narainmajji (BOB member since 2006-04-27)
I see this was never answered but I ran into the same issue with Perl where I had to force “False” to be a variant type
See: http://search.cpan.org/dist/Win32-OLE-CrystalRuntime-Application/
use constant False=> Win32::OLE::Variant->new(VT_BOOL, 0);
mrdvt92 (BOB member since 2008-09-18)