如何获取Crystal Reports中记录的交替背景颜色
问题描述:
我以灰色和白色等交替颜色显示记录。但是,我抑制了一些记录,例如抑制白色背景记录,然后下一个记录是灰色的,所以我最终得到灰色的两个记录。
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.
下面是
iif (RecordNumber mod 2 = 1, crwhite, rgb(214,214,214))
即使在抑制了一些记录之后,有办法获得交替颜色吗?
Is there a way to get alternating colours even after suppressing some records?
答
假设公式{@SuppressSection?}保存您的抑制逻辑,我建议使用以下颜色公式:
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.