php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37562 Unable to lookup "ParameterFieldDefinitions"
Submitted: 2006-05-23 16:42 UTC Modified: 2020-02-16 04:22 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mitohuffman at yahoo dot com dot mx Assigned: cmb (profile)
Status: No Feedback Package: COM related
PHP Version: 5.1.4 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 27 = ?
Subscribe to this entry?

 
 [2006-05-23 16:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-15 08:36 UTC] jani@php.net
Assigned to the maintainer.
 [2007-09-17 22:47 UTC] melam02 at yahoo dot com
try  $creport->ParameterFields->Item(1)
 [2008-01-31 21:04 UTC] 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.
 [2013-12-13 07:47 UTC] wez@php.net
-Status: Assigned +Status: Open -Assigned To: wez +Assigned To:
 [2020-02-07 08:22 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-02-07 08:22 UTC] cmb@php.net
While "Unable to lookup `ParameterFieldDefinitions': Unknown name"
might hint a bug in PHP's COM implementation, it is more likely to
be an API misuse (what is confirmed by spiro79@ above). So please
check the CrystalReports API documentation whether your code is
correct, and if it seems so, please verify using another COM
binding (e.g. VBScript).
 [2020-02-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jun 03 03:01:25 2020 UTC