Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a report with multiple groups where I would like to alternate row color in the rows details and group footer.

i am using if RecordNumber mod 2 = 0 then crSilver else crNoColor for details and if GroupNumber mod 2 = 0 then crSilver else crNoColor for my group but sometime it gives the same color of row and group lines

pls help
Posted

1 solution

sometimes you end up with groups inexplicably not shown in alternating colors. This probably has something to do with conditional suppression of group records. Instead of depending on the GroupNumber NumberVar, we will just do something similar to a manual running total:

Shared NumberVar GroupNum;
GroupNum := GroupNum + 1;
if Remainder(GroupNum, 2) = 0 then crNoColor
else Color(240,240,240)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900