CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Label with Name and Surname

Print topic Send  topic

Author Message
adorni

Posts: 120
Posted: 08/01/2012, 2:11 PM

Hi. I have a label with this from database:

Table:

Name
JOAN MANUEL ADORNI
BETtina ANGEletti

I need to see in a grid when i put the label with this label, this:

Joan Manuel Adorni
Bettina Angeletti.

How i can do this?

Thanks!

View profile  Send private message
solesz

Posts: 137
Posted: 08/02/2012, 4:42 AM

If you have to convert the srting data into a form where first letter has to be only upper case in each word, than you have to capitalze the words in a right way.

In php first you makes everything lowercase with strtolower(), than separate the string at spaces by explode() and each word has to be put into ucfirst() function (iterating through the array) which makes the first letter only uppercase. Then finally the implode() will put the array into a string again.
View profile  Send private message
adorni

Posts: 120
Posted: 08/02/2012, 5:14 AM

Thanks!!!

But in CCS, where i put this php code???

Thanks!
View profile  Send private message
solesz

Posts: 137
Posted: 08/02/2012, 5:23 AM

If i am not wrong the label "before show" event - Custom Code
View profile  Send private message
DataDoIT
Posted: 08/02/2012, 9:11 AM

For the label's Before Show, add a Retrieve Value for Control action,
and set to...

Control Name:
Source Type: Expression
Source Name: ucwords(strtolower($Component->GetValue()))
solesz

Posts: 137
Posted: 08/03/2012, 7:57 AM

Sorry, I a little bit overcomplicated it with the ucfirst() instead of using ucwords().
Thanks for correction.
View profile  Send private message
adorni

Posts: 120
Posted: 08/03/2012, 1:08 PM

I will try. Very very thanks
View profile  Send private message
adorni

Posts: 120
Posted: 08/06/2012, 12:44 PM

I try, but... i have:

ADORNI, MANUEL

And this function show:

Adorni, manuel

Works fine, but "M"anuel not work.

Thanks!
View profile  Send private message
adorni

Posts: 120
Posted: 08/07/2012, 5:21 AM

was ucwords :).

Thanks!!! Works fine!!!
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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