Hi All

I am having an issue with alternating colors in a Crystal Report. I have several groups and the alternating colors formula is in Group six the formula I am using is:

if groupnumber mod 2 = 0 then

crNoColor

else

{@ICONTeal}

However, it's works fine on pages 1 and 2 then it gets funky on page 3 where it highlights 2 rows with the same color then 2no color then 6 with color 1 without.

Is there something wrong with the formula or is there a different formula I should use so that the shading is consistent throughout the report.

Any help greatly appreciated.

Thanks

I use another way to solve this:

1. Create a formula with shared (or global if you like) variable

Shared NumberVar gr_cnt :=0;

True;

put it into report header and minimize it.

2. Create formula

Shared NumberVar gr_cnt;

gr_cnt := gr_cnt + 1

and place it into grop header where you want to have different color. I usually make them very tiny so you can't see it.

Now use that second formula instead of groupnumber.

In this case it will count just top-level groups and result should bre correct.

Probably not the best way but it works for me :)