Bug #37562 [Asn->Opn]: Unable to lookup "ParameterFieldDefinitions"
Edit report at https://bugs.php.net/bug.php?id=37562&edit=1
ID: 37562
Updated by: wez@php.net
Reported by: mitohuffman at yahoo dot com dot mx
Summary: Unable to lookup "ParameterFieldDefinitions"
-Status: Assigned
+Status: Open
Type: Bug
Package: COM related
Operating System: Windows XP SP2
PHP Version: 5.1.4
-Assigned To: wez
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2008-01-31 21:04:52] spiro79 at gmail dot com
Happened the same to me but then I tried changing one line like in an example on the infamous
Crystal Report's Developers Help:
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
to:
$crapp = $ObjectFactory->CreateObject("CrystalRunTime.Application");
Notice the lack of the word 'Design'.
All of a sudden it started to work. Why it happens? I don't know but it worked for me.
Give it a try.
------------------------------------------------------------------------
[2007-09-17 22:47:50] melam02 at yahoo dot com
try $creport->ParameterFields->Item(1)
------------------------------------------------------------------------
[2007-08-15 08:36:39] jani@php.net
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-05-23 16:42:26] mitohuffman at yahoo dot com dot mx
Description:
------------
I made a script that open a Crystal Reports file and export it to PDF. I set the database info, the
RecordSelectionFormula string and de ExportOptions and all works fine. The problem comes when i try
to call the ParameterFieldDefinitions class.
GBY
Reproduce code:
---------------
$ObjectFactory= New COM("CrystalReports10.ObjectFactory.1");
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
$creport = $crapp->OpenReport($report, 1);
$creport->Database->Tables->Item(1)->ConnectionProperties['User ID'] =
"MyUser";
$creport->Database->Tables->Item(1)->ConnectionProperties['Password'] =
"MyPass";
$creport->FormulaSyntax = 0;
$creport->RecordSelectionFormula = "{V_CON_LOTES.ID_CONCURSO}=$id_concurso and
{LOTES_CONCURSO_COTIZADOS.ID_ESTATUS}=1";
$param1 = $creport->ParameterFieldDefinitions->Item("fecha_imp"); // Error Point. I
tried using Item(1) and i get the same error.
Expected result:
----------------
Get the "Fecha_imp" parameter, set (before) in the Crystal Reports Designer, for setting
the corresponding value.
Actual result:
--------------
Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup
`ParameterFieldDefinitions': Nombre desconocido. ' in
C:\Inetpub\wwwroot\Crystal_reports\test.php:19 Stack trace: #0
C:\Inetpub\wwwroot\Crystal_reports\test.php(19): unknown() #1 {main} thrown in
C:\Inetpub\wwwroot\Crystal_reports\test.php on line 19
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=37562&edit=1
Thread (7 messages)