Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Alternate row shading in crosstabs Post Reply Post New Topic
Author Message
Johny_Mc
Newbie
Newbie


Joined: 30 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote Johny_Mc Replybullet Topic: Alternate row shading in crosstabs
    Posted: 16 Jan 2014 at 11:09pm
Hi All,
I want to format a crosstab with alternate row shading. I have used the formula below using the formula workshop in the background properties of the inner cell in the crosstab.    If I apply to a cross as in the second example below it works  However in the first example cross tab below I get a chessboard effect rather than alternate row shading.  I am guessing because there is only one value for each row element Crystal is working left to right for all the cells in the cross tab rather than just for the row value. 
Is it possible to do alternate row shading on a crosstab that only has 1 value.
TIA John 
numbervar x:= x + 1;
if remainder(x,2) = 0 then RGB(219,219,219) else RGB(240,240,240)
           day1  day2  day3  Total
hour1   1       2          3         6
hour2    1       2          3        6
hour3     1       2         3        6
Total       3      6         9        18 
            True   False   Total
Day 1     21       5         26
Day2       10      10       20
Total       31      15       46
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Jan 2014 at 4:52am
what I would try is, and I don't use cross tabs so I could be completely wrong...is to have 2 formulas. 1 formula for the far left cell, this one would incremement x, the other cells would have the same formula but without the incrementing.

HTH
IP IP Logged
Johny_Mc
Newbie
Newbie


Joined: 30 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote Johny_Mc Replybullet Posted: 21 Jan 2014 at 11:46pm
Hi Lockelle,
I tied to figure a way of implementing your suggestion and got stuck.  It made me think was there such as fucntion as row index.  A quick bit of google and found the function currentrowindex I then wrote the following formula and applied it to the border / background properties for my inner cell of the cross tab and my table is now has alternate row shading.

numbervar x:= currentrowindex;
If remainder(x,2) = 0 then  RGB(219,219,219) else RGB(240,240,240)

Thanks for your help.
John



Edited by Johny_Mc - 21 Jan 2014 at 11:52pm
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.