How to get alternating background colour for recor

2019-09-19 09:44发布

I am displaying records in alternating colour like grey and white. But, I am suppressing some records, for example suppressing a white background record and then the next record is gray so I end up getting gray colour for two records.

Below is the code used in the section for alternating colour.

iif (RecordNumber mod 2 = 1, crwhite, rgb(214,214,214))

Is there a way to get alternating colours even after suppressing some records?

1条回答
Animai°情兽
2楼-- · 2019-09-19 10:07

Assuming the formula {@SuppressSection?} holds your suppression logic, I would suggest using the following color formula:

booleanvar alternate;
if not({@SuppressSection?}) then alternate:=not(alternate);
if alternate then crWhite else color(214,214,214) 

This will ignore suppressed sections and only alternate the color for displayed records.

查看更多
登录 后发表回答