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!
|
 |
 |
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.
|
 |
 |
adorni
Posts: 120
|
| Posted: 08/02/2012, 5:14 AM |
|
Thanks!!!
But in CCS, where i put this php code???
Thanks!
|
 |
 |
solesz
Posts: 137
|
| Posted: 08/02/2012, 5:23 AM |
|
If i am not wrong the label "before show" event - Custom Code
|
 |
 |
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.
|
 |
 |
adorni
Posts: 120
|
| Posted: 08/03/2012, 1:08 PM |
|
I will try. Very very thanks
|
 |
 |
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!
|
 |
 |
adorni
Posts: 120
|
| Posted: 08/07/2012, 5:21 AM |
|
was ucwords :).
Thanks!!! Works fine!!!
|
 |
 |