Alternate Row Shading Crosstab
Alternate Row Shading Crosstab
(OP)
I know there have been a bunch of threads addressing this question, but I can't find an answer that works. I have a very simple crosstab in CR XI.
Rows: Trends.SrcName
Column: Trends.Dates
Summarized Field: Average of Trends.Trend
I want every other row to be shaded. The crosstab is in Report Header and will never cross on to a second page. The data for SrcName and Dates vary for each company database I run the report on. Is there a formula I can use? If a manual cross tab is better I would assume I would have to use formula field saying:
If trends.dates = (the first date) then trends.trend
I know how I would do this if I knew the first date (ie. trends.dates = "12/24/10") but it is not constant from database to database. How would I address this?
Rows: Trends.SrcName
Column: Trends.Dates
Summarized Field: Average of Trends.Trend
I want every other row to be shaded. The crosstab is in Report Header and will never cross on to a second page. The data for SrcName and Dates vary for each company database I run the report on. Is there a formula I can use? If a manual cross tab is better I would assume I would have to use formula field saying:
If trends.dates = (the first date) then trends.trend
I know how I would do this if I knew the first date (ie. trends.dates = "12/24/10") but it is not constant from database to database. How would I address this?

Talk To Other Members
RE: Alternate Row Shading Crosstab
-LB
RE: Alternate Row Shading Crosstab
http://tek-tips.com/viewthread.cfm?qid=1594363
... the lables and first columm line up, after that, they alternate.
RE: Alternate Row Shading Crosstab
-LB
RE: Alternate Row Shading Crosstab
The crosstab is in GH1.
I have a formula field @reset that has been placed in both the report header and GF1 that says:
whileprintingrecords;
numbervar d;
if remainder(distinctcount({Trends.SrcName}),2) = 0 then
d := 200 else
d := 255;
The inner cells:
whileprintingrecords;
numbervar c;
if c = 0 then
c := 200
else if c = 255 then
c := 200 else
c := 255;
color(200,c,200)
Row Lables:
whileprintingrecords;
numbervar d;
if d = 200 then
d := 255 else
if d = 255 then
d := 200;
color(200,d,200)
RE: Alternate Row Shading Crosstab
-LB
RE: Alternate Row Shading Crosstab
RE: Alternate Row Shading Crosstab
To make this work without totals, do the following. Change the reset formula to:
whileprintingrecords;
numbervar d;
numbervar cnt := 0;
if remainder(distinctcount({Trends.SrcName}),2) = 0 then
d := 200 else
d := 255;
Select the inner cells and add a formula to format field->suppress->x+2:
whileprintingrecords;
numbervar cnt;
if cnt/distinctcount({Trends.SrcName}) = 1 then
cnt := 0;
false
Then change the color format formula for the inner cells to:
whileprintingrecords;
numbervar c;
numbervar cnt;
if remainder(cnt,distinctcount({Trends.SrcName})) = 1 then
c := 255 else
c := c;
if c = 0 then
c := 200 else
if c = 255 then
c := 200 else
c := 255;
color(200,c,200)
-LB
RE: Alternate Row Shading Crosstab
RE: Alternate Row Shading Crosstab
whileprintingrecords;
numbervar c;
numbervar cnt := cnt + 1;
if remainder(cnt,distinctcount({Trends.SrcName})) = 1 then
c := 255 else
c := c;
if c = 0 then
c := 200 else
if c = 255 then
c := 200 else
c := 255;
color(200,c,200)
-LB
RE: Alternate Row Shading Crosstab