CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How do i replace values from DB with text ?

Print topic Send  topic

Author Message
Simon
Posted: 08/28/2002, 7:25 AM

I my database, the access level of the user is stored as numbers. eg.
16 equals Admin Level

When displaying records (generated by a search) in a grid, how do i get CC to show the text "Admin" instead of "16" in the Access Level Column ??

Thanks in advance.
WilliamB
Posted: 08/28/2002, 9:13 AM

In the Field Properties window for a Label field, you can define a 'List of Values'. For instance 16;Admin will display 'Admin' when the value 16 is retrieved from the database.
Zam
Posted: 08/28/2002, 9:51 AM

How is the same done in CodeCharge Studio ?
Tom
Posted: 08/28/2002, 9:11 PM

I asked the same question to Yes Software for CCS and there is no equivalent 'join' as in CC.
You either have to sql join the look up table in your query or do a before show event and translate the value yourself.
Simon
Posted: 08/29/2002, 2:51 PM

Tom,

Do you have an example code in PHP that translates the values->txt ..
im not at all skilled in coding PHP.
Nicole
Posted: 08/30/2002, 2:15 AM

Simon,
Here is sample code for before Show Row event:
global $form_name;
if ($form_name->field_name->Value == "1")
$form_name->field_name->SetValue("black");
if ($form_name->field_name->Value == "0")
$form_name->field_name->SetValue("white");
Note, that field_name type should be text in this case.

   


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.