CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 GetValue() on column not in grid

Print topic Send  topic

Author Message
thierrybo

Posts: 8
Posted: 02/01/2005, 2:04 PM

Hi,

I have a "before show" event in my datagrid within one column. I want to change the displayed value depending on the value of another field. This is normally easy using
$gridObject->fieldName->GetValue()


However, I try to read value from a field that is NOT in the grid (I mean, not displayed), but this field IS selected in the datasource (in SELECT statement).

Is this the reason why I get
Fatal error: Call to a member function on a non-object in 
?

I don't want to make another query just to do that, so is there a mean to read field value from fields in SELECT statement but not displayed in grid ?

Thierry B.
View profile  Send private message
aakici


Posts: 49
Posted: 02/01/2005, 4:25 PM

if you want to use GetValue then you must add a hidden textbox to your form.

however, you can get the value from your sql by assigning the sql result to a variable. For example;

$SQL = "SELECT SUM(ordertotal) As total FROM orders WHERE order_customer_id=" . CCToSQL($kosul,ccsInteger);
$db->query($SQL);
$Result = $db->next_record();
$result = doubleval($Result);
if ($Result) {
$deger =$db->f("total"); //Here is a variable assigned by an Sql result
}

_________________
Regards,
M.Alpaslan AKICI
View profile  Send private message
Nicole

Posts: 586
Posted: 02/02/2005, 2:54 AM

Hello,
You can also retrieve a value directly from a recordset, e.g.:
  
global $gridObject;  
$gridObject->control_name->SetValue($gridObject->ds->f("field_name"));  

_________________
Regards,
Nicole
View profile  Send private message
thierrybo

Posts: 8
Posted: 02/02/2005, 3:51 AM

Thanks to aakici and Nicole. I will try both hidden textbox and retrieving value directly from the recordet, although I believe the second solution is more 'clean'.

Thierry B.
View profile  Send private message
aakici


Posts: 49
Posted: 02/02/2005, 11:19 AM

I think so. :-)
_________________
Regards,
M.Alpaslan AKICI
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.