Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternating shading properly within a multi-column report 1

Status
Not open for further replies.

jcrawford08

Technical User
Nov 19, 2008
71
US
Hi all,

Working with CR 11; I have my groups set to columns with my details and would like all data on row 1 one color and all data on row 2 a separate color etc.

I have the following as a surpresssed formula in the GH2 (that's where the data is):

whileprintingrecords;
numbervar cnt := cnt + 1;
cnt

and then in the section expert for GH2, I have the following formula:
whileprintingrecords;
numbervar cnt;
if remainder(cnt,2) = 0 then
color(234,234,234) else
color(218,221,254)

This works fine and dandy if you only have one column, but as you add multiple columns, in this case two, it just shows up with one column one color and the other column another color.

I have it set up on another report where the columns are set to go down and then across, but this report needs to go across and then down, and I am having a hard time setting up the formula to change the shading only a row change, not just on a record change. I have another report that is three columns and I have the same dillemma.... any ideas?

 
You can try and see if this formula works for you.

@var AlternateShading
If RecordNumber Mod 2 = 0
Then color(234,234,234)
Else (218,221,254)

Thanks.

 
Leave your cnt formula as is and then use the following to format the group header section for color:

Replace the 4 with the number of columns in your report:

whileprintingrecords;
numbervar cols := 4; //number of columns
numbervar cnt;
numbervar i;
numbervar x;
if remainder(cnt,cols)= 1 then
i:= i + 1;
if remainder(i,2) = 0 then
x := color(234,234,234) else
x := color(218,221,254);
x

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top