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.
Crystal Reports

Avatar of undefined
Last Comment
Taras

8/22/2022 - Mon
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
ASKER
Taras

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;
Mike McCracken

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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER
Taras

No it is not working. Still it is showing the group name as it is in field  table1.RoleName.
James0628

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
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Taras

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.