• Status: Solved
• Priority: Medium
• Security: Public
• Views: 379

Alternating Colors on Groups Crystal Reports

Hi All

I have a report that has 4 Groups and I would like to alternate same  colors on Group 3 and Group 4.

For example if the first color is blue then Group 3 and Group 4 would be blue for that record and the next record Group 3 and 4 would white and so on.

Is there a way this can be accomplished?

Any help greatly appreciated.

0
nobile00
• 4
• 4
1 Solution

Commented:
Is this by record or for the group since a group can have more than 1 record.

mlmcc
0

Author Commented:
Groups so group 3 and 4 would be blue at 1st set of records then group 3 and 4 would have white for the second set of records and so I on hope that makes sense.  Let me know if you need more info.

Thanks
0

Commented:
Basically you want

GH3 - BLUE
GH4
Details
Details
GF4
GH4
Details
Details
GF4
GF3
GH3 - WHITE
GH4
Details
Details
GF4
GH3 - BLUE  etc

mlmcc
0

Author Commented:
like this
GH3 - BLUE
GH4-Blue
GH3 - WHITE
GH4-White
GH3 - BLUE
GH4-Blue
GH3 - WHITE
GH4-White
0

Commented:
There is only 1 G4 for each G3?

GH3 - BLUE
GH4-Blue
GH4 - ???
GH4 - ???
GH3 - WHITE
GH4-White
GH3 - BLUE
GH4-Blue
GH3 - WHITE
GH4-White

If there is only one then try this idea
WhilePrintngRecords;
Global NumberVar GroupCount;
""

Add a formula to the GH3 background formula
WhilePrintngRecords;
Global NumberVar GroupCount;
GroupCount := GroupCount + 1
If GroupCount MOD 2 = 0 then
crBlue
Else
crWhite

GH4 formula
WhilePrintngRecords;
Global NumberVar GroupCount;
If GroupCount MOD 2 = 0 then
crBlue
Else
crWhite

mlmcc
0

Author Commented:

For the Group 3 Formula below I am getting an error from Crystal that this part of the formula doesn't appear to be part of the formula.
If GroupCount MOD 2 = 0 then
{@ICONTeal}
Else
crWhite

WhilePrintingRecords;
Global NumberVar GroupCount;
GroupCount := GroupCount + 1
If GroupCount MOD 2 = 0 then
{@ICONTeal}
Else
crWhite

0

Commented:
Missing a ; after GroupCount + 1

WhilePrintingRecords;
Global NumberVar GroupCount;
GroupCount := GroupCount + 1;
If GroupCount MOD 2 = 0 then
{@ICONTeal}
Else
crWhite

mlmcc
0

Author Commented:
The formulas worked perfectly.

Thanks so much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.