Crystal Reports : Background Color

crystal 8.5

I want to highlight records in pairs (so, for example, record 1 and 2 are green, 3 and 4 are white, 5 and 6 are green)

i have
if RecordNumber mod 2 = 0 then color(148,233,196)
else
color(255,255,255)

which gives me every other record... how to i get it to color by pairs of records?

thanks
LVL 44
zephyr_hex (Megan)DeveloperAsked:
Who is Participating?
 
bdreed35Commented:
Slight change:

if RecordNumber mod 4 in [1,2] then color(148,233,196)
else
color(255,255,255)
0
 
bdreed35Commented:
Try this:

if RecordNumber mod 4 in [0,1] then color(148,233,196)
else
color(255,255,255)
0
 
zephyr_hex (Megan)DeveloperAuthor Commented:
bingo!

thanks ;)

does [1,2] represent the array positions for RecordNumber?
0
 
bdreed35Commented:
No, it represents the remainder value that the MOD function returned.
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.

All Courses

From novice to tech pro — start learning today.