Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Crstal Report alternate color Help? Post Reply Post New Topic
Page  of 2 Next >>
Author Message
imran_amodi1
Newbie
Newbie


Joined: 02 May 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 2
Quote imran_amodi1 Replybullet Topic: Crstal Report alternate color Help?
    Posted: 02 May 2009 at 7:23am

Hello Friends,
I have a crystal report, Crystal Report contains a Table and I change the alternate color of the Rows using the following formula:

if RecordNumber mod 2 = 0 then crSilver else crNoColor
I want the alternate color to be within the Table, but the alternate color is applied outside the Table also. How to do it?
Thanks.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2009 at 9:43am
1. What do you mean by a "table"? A crosstab or something else?
2. Where exactly did you place the formula?
IP IP Logged
imran_amodi1
Newbie
Newbie


Joined: 02 May 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 2
Quote imran_amodi1 Replybullet Posted: 02 May 2009 at 11:30pm

Hello DBlank,

                         Sorry for not being clear.

1.       What do you mean by a “table”? A crosstab or something else?

a.       I added a Group section (Right-Click on Details Section ->Report -> Group Expert).

b.      I used line objects to draw a table around the group section( Right-Click on Report -> Insert -> line )

2.       Where exactly did you place the formula?

a.       Right-Click on Details Section -> Report -> Section Expert  -> Select Details in the Sections list -> Select color TAB -> Check BackGround Color ->  click small Button beside colors ComboBox for formula workshop . ( wrote that above formula )

Thanks.

 

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 May 2009 at 6:48am

Still not sure exactly how this is functioning othe than perhaps your "table" is only in one grouping and not another.

If this is the case you can add another condition into the formula to only highlight every other row under that conditin also.
something like:
if RecordNumber mod 2 = 0 and {table.field}=condition then crSilver else crNoColor
if that does not work can you explan your set up more and conditionally where you need it to color and not color?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 May 2009 at 6:05am
It sounds like you applied the alternating color scheme to the details section, but you drew your table around a group section...
 
If you only want the group section to alternate, you would need to put the color formula on the group section. 
 
If I have this right, your formula might give inconsistent results as the record numbers might all be even or odd, depending on the detail records below them.  If so, you might want to change to a shared variable to use as a counter.
 
 
IP IP Logged
skailey
Newbie
Newbie


Joined: 13 Jul 2009
Location: United States
Online Status: Offline
Posts: 13
Quote skailey Replybullet Posted: 13 Jul 2009 at 1:24pm

Hey everyone.. I am new here and stumbled across this thread and I hope you can help me.  I have a similar situation, however, I have records that may have multiple rows, or may not.  I need the details section to alternate based on the record, not the row.  For example:

 
record A
record A
record A
record B
record C
record C
record D
record D
record D
 
I have played around with it and don't seem to be able to get it quite right.  Any help would be appreciated.
 
Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jul 2009 at 1:41pm
Create a Running Total as:
Name="ColorCounter" (or whatever you want)
Field to summarize= RECORD A, B , C field (from above)
Type of Summary is = COUNT
Evaluate as= On change of field (same field as above)
RESET = Never.
 
You can place this on your detail row to validate it and it should look like this:
 
record A  1
record A  1
record A  1
record B   2
record C  3
record C  3
record D   4
record D   4
record D   4
 
Now you can use the conditional formula to change your color as:
if {#ColorCounter} mod 2 = 0 then crBlue else crBlack
 
To change the ink color for the field REcord A,B,C... right click on it, select Format Field.
Click on the Font Tab
Click on the Color Formula and add in:
if {#ColorCounter} mod 2 = 0 then crBlue else crBlack
 
To Bold it add the formula in the Style option (just above the color option) as:
if {#ColorCounter} mod 2 = 0 then crBold else crRegular


Edited by DBlank - 13 Jul 2009 at 1:46pm
IP IP Logged
skailey
Newbie
Newbie


Joined: 13 Jul 2009
Location: United States
Online Status: Offline
Posts: 13
Quote skailey Replybullet Posted: 13 Jul 2009 at 1:54pm
Works like a charm.  Thank you!
IP IP Logged
skailey
Newbie
Newbie


Joined: 13 Jul 2009
Location: United States
Online Status: Offline
Posts: 13
Quote skailey Replybullet Posted: 28 Sep 2009 at 11:23am
Hello, I am back and I am now needing to modify how this is working for my report.  I am now supressing loans in the detail section of the report where I was not doing so before.  It worked great when I wasn't supressing anything from the detail section, but now that I am, the color coding below is still working on all records, instead of those that are just showing up in the detail section (that do not meet the supression criteria).  Any ideas on how I can apply this to those loans that don't meet the supression criteria?
 
Thanks for your help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Sep 2009 at 11:41am
Change your RT evaluation to use a formula. The formula will be 2 parts.
The first part is your condition to show the row (opposite of your suppress condition) and the second is on change of the field as next(record ABCfield)<>recordABCfield
IP IP Logged
Page  of 2 Next >>
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.