Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Colour alternative rows Post Reply Post New Topic
Author Message
Jock
Newbie
Newbie
Avatar

Joined: 29 Mar 2012
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Jock Replybullet Topic: Colour alternative rows
     Posted: 12 Nov 2013 at 11:05pm

What is the easiest/best way to apply colour striping to alternative rows of data?

Thanks.
Traa dy liooar
IP IP Logged
Jock
Newbie
Newbie
Avatar

Joined: 29 Mar 2012
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Jock Replybullet Posted: 13 Nov 2013 at 1:20am
Found my answer on BOBJ Tricks' blog:
 
if Remainder(RecordNumber, 2) = 1
then RGB(235,245,255)
else RGB(255,255,255)

does the job nicely!
Thanks.
Traa dy liooar
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Nov 2013 at 8:07am
many people will also do:
if RecordNumber mod 2 = 1...

Mod does the exact same as remainder.

Just another way to solve the puzzle
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Nov 2013 at 9:34am
2 more things to note
 
If you use shared variables or Running Totals in lieu of the RecordNumber you can
1.keep multiple 'like' rows together and change the color on the change of a field or other condition
2. easily cotrol how the first record in the group is set (reset the running total or variable on group changes)
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum