Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Background Color change in Detail Section Post Reply Post New Topic
Author Message
aeromonte
Newbie
Newbie


Joined: 25 Feb 2008
Location: United States
Online Status: Offline
Posts: 18
Quote aeromonte Replybullet Topic: Background Color change in Detail Section
    Posted: 03 Mar 2009 at 12:24pm
Anyone know how I would have the background color change in the Detail section when a record changes?? 
 
Example: I have multiple quotes and multiple lines per quote - I would like the background color in the detail section to alternate between white and gray when a new quote starts (so all the lines per quote are colored the same as the quote they belong to).
 
Thanks
John
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Mar 2009 at 12:54pm
Having a little trouble understanding your set up. Can you post the set up to explain it?  Example: Do you have multiple detail sections or one detail section?
IP IP Logged
aeromonte
Newbie
Newbie


Joined: 25 Feb 2008
Location: United States
Online Status: Offline
Posts: 18
Quote aeromonte Replybullet Posted: 03 Mar 2009 at 1:00pm
Just one detail section.  Example:
 
123456 (quote 1)  Line1 
123456                  Line2
123456                  Line3
 
123457 (quote 2)  Line1
 
123458 (quote 3)  Line1
123458                 Line2
 
Want the background color of the detail section to change when a new quote number changes example: from 123456 to 123457
 
Does that make sense?
Thanks!


Edited by aeromonte - 03 Mar 2009 at 1:02pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Mar 2009 at 1:39pm
Still looks like this is just expanding your row size to accomodate the full quote or do you have 3 seperate data items for quote one?
If it is just expanding you can do a conditional highlight on every other record by going to Section expert, click on Details then the color tab and insert the formula:
If (RecordNumber Mod 2 = 0) Then crSilver Else DefaultAttribute;
 
reference to
Does this do it or are there 3 distinct rows for quote 123456?
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 04 Mar 2009 at 1:02am
you can create a running total field say "totrec" and place this in detail section and supress it. while creating the running total field in the evalute option select the "use a formula" write the below formula

previous(<filedname>) <> (filedname) (this filed name which contains the data 123456,123457 of your table).


Now in the section expert of detail section, select the color tab and check the background color. In the formula you can write the following code.


if {#totrec} mod 2 = 0 then
crblue
else
crwhite;

Edited by Savan - 04 Mar 2009 at 1:24am
Thanks
Savan
IP IP Logged
aeromonte
Newbie
Newbie


Joined: 25 Feb 2008
Location: United States
Online Status: Offline
Posts: 18
Quote aeromonte Replybullet Posted: 04 Mar 2009 at 5:36am

Yes, each Line (with repeating quote number) is a new row (detail section record)

Savan, this worked perfectly!!!  Thanks so much!! 
 
I just named the new running total field "ColorChange", instead of "totrec", so I will remember what it is in the future.  I also changed the background color, because the blue was too dark.
 
Now when the quote number changes, the color alternates back and forth.  All the lines associated with each quote number are the same color as the quote they belong to.
 
Thanks again!
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.016 seconds.