Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Adding colors to the detail Post Reply Post New Topic
Author Message
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Topic: Adding colors to the detail
    Posted: 09 Jun 2011 at 9:51am
How do I add color to every other detail or every other row of details?  Is there a way to do this?
 
Thanks,
Carl
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2011 at 9:55am
if you are not suppressing any rows
 

If (Recordnumber Mod 2 = 0) Then Color (R,G,B) Else crNocolor;

 

othwise you need a RT to get the value for each row (a counter)

If ({#RT} Mod 2 = 0) Then Color (R,G,B) Else crNocolor;



Edited by DBlank - 09 Jun 2011 at 9:56am
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 09 Jun 2011 at 10:13am
I'm not able to get this to work.  I'm trying it in the section expert under color.  Is that right?
 
I keep getting "The ) is missing" right after the R of (R,G,B).
IP IP Logged
herman
Newbie
Newbie


Joined: 01 Mar 2011
Location: United States
Online Status: Offline
Posts: 30
Quote herman Replybullet Posted: 09 Jun 2011 at 10:20am
I got it.  I changed the formula to the follow:
 
If (Recordnumber Mod 2 = 0) Then crSilver Else crNocolor
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2011 at 10:25am
yes
the COLOR() allows you to control the color using RGB values
I generally use COLOR(236,242,242) as a more subtle version of crsilver
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 09 Jun 2011 at 2:30pm
You can also use:
select RecordNumber mod2
case 0:crWhite
case 1: color(225,225,225)
default: crWhite //this line is optional

Or you can apply it for groups by changing it to

select GroupNumber mod2
case 0:crWhite
case 1:color(225,225,225)
default: crWhite //this line is optional

If you want to do 2 lines at a time then:

If Remainder(RecordNumber, 4) In [1,2] Then crSilver
Else NoColor
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.