CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Get value from another table (resolved)

Print topic Send  topic

Author Message
pathans

Posts: 46
Posted: 11/08/2012, 4:29 PM

I have a grid(results) which is showing following information.

db_fieldname| old value | new value.
============================
asset_name| pc123 | pc456
asset_env | 2| 3

I want to replace 2 and 3 for asset_env from assets_envir table (assets_env_name)

Don't know how to do whole sql. can someone please help.
if i am not wrong it would be something like this in before show.

if ($Results->db_field->getvalue () = ' assets_env'{

$results->oldvalue->setvalue = ( sql statment);

}

so grid would show something like this
db_fieldname| old value | new value.
============================
asset_name| pc123 | pc456
asset_env | prod | stage

View profile  Send private message
Lucius

Posts: 220
Posted: 11/09/2012, 6:23 AM

Use Before Show Row Event and CCDLookUp (check this function in CCS help), it would look like something in lines of:
  
$db = new clsDB_YOUR_DB_NAME_;  
  
if ($Results->db_field->getvalue () = ' assets_env' {  
$results->oldvalue->setvalue( CCDLookUp("assets_env_name", "assets_envir", " assets_env = '".$results->oldvalue->getvalue()."'", $db));  
  
}  
  
View profile  Send private message
pathans

Posts: 46
Posted: 11/09/2012, 1:40 PM

Thank you it worked.
I was doing it under beforeshow for the form i guess that doesn't work plus there was a typo i think in my code

thanks again
View profile  Send private message
Lucius

Posts: 220
Posted: 11/10/2012, 1:24 AM

Before show event applies to the grid as a whole, not a specific row. So you can change anything that is not inside actual grid row.

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.