Link to home
Start Free TrialLog in
Avatar of Taras
TarasFlag for Canada

asked on

Crystal Report group header UCase

I How to make group header UCase. Group is based on formula.
Avatar of Mike McCracken
Mike McCracken

You can change the formula to return the uppercase

UCase or Uppercase

You can set the group to show a value based on a formula (2nd tab)

UCase({Groupformula})

mlmcc
Avatar of Taras

ASKER

I have this formula to adjust g names but this is not working.

@AdjustGName;


Global StringVar GName;

If {table1.RoleName} = "Chair" Then

GName:="Club Current Chair"

ELSE

If {table1.RoleName} = "Warden" Then

GName:= "Club Warden"

ELSE

If {table1.RoleName} = "Secretary" Then

GName:= "Club First Secretary"

Else

GName:= {Table1.RoleName}; // this means that other role names stay //unchanged.

GName:= UpperCase(GName);
GName;
What isn't working?

You might try using it as

@AdjustGName;


Global StringVar GName;

If UCase{table1.RoleName}) = "CHAIR" Then

      GName:="Club Current Chair"

ELSE

If UCase({table1.RoleName}) = "WARDEN" Then

     GName:= "Club Warden"

ELSE

If UCase({table1.RoleName}) = "SECRETARY" Then

    GName:= "Club First Secretary"

Else

GName:= {Table1.RoleName}; // this means that other role names stay //unchanged.

GName:= UpperCase(GName);
GName; 

Open in new window


mlmcc
Avatar of Taras

ASKER

No it is not working. Still it is showing the group name as it is in field  table1.RoleName.
Are you saying that you're not seeing uppercase strings?  If you put that formula on the report, I don't see how it could not give you an uppercase string.

 If you're seeing uppercase strings, but you're not getting your replacement strings, like "CLUB WARDEN", then I'd have to assume that there is something wrong with your tests.

 Maybe the case is wrong (eg. the field is "warden", not "Warden"), but mlmcc's suggestion should handle that.

 Or maybe the field contains more than just the words that you're looking for.
  "Warden 2" <> " Warden" <> "Warden"

 If, for example, you're looking for any string that contains the word "Warden", you can use Like:
{table1.RoleName} like "*Warden*"

 James
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Taras

ASKER

Hi mlmcc.
It is working now. I was using group expert to change group and picked up AdjustGName as the field for changed group. It did not work on that way.
It worked when I bring formula in group header. Then it shows proper UCase and changed  Club role names .
What was happening It looks like when I changed group through group expert it just put the new group name in group header, not actual formula AdjustGName.
I should know that in group header you have just title (label ) of  changed group header, that was my mistake.
Thanks for your help.