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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shading Alternate Group Header and Detail Sections

Status
Not open for further replies.

cocopud

Technical User
Jan 8, 2002
139
0
0
US
I have a report that prints out a Group Header and then any of the following detail sections a, b, c, d and e. Sometimes all the detail sections print out and other time just one or a few of them. I would like to shade the Group Header and any of the detail sections that follow it and then alternate starting at the next Group Header. I have played around with it, but my details section are either alternating the shading or the entire report is shaded.
Any ideas the best way to do this. Thanks.
 
Are you using any sectin suppression? If not, you should be able to create a formula like this:

whileprintingrecords;
numbervar cnt := cnt + 1;

Place the above formula in both group header and detail sections and suppress it.

Then go to the section expert->group header->color->backgound->x+2 and enter:

whileprintingrecords;
numbervar cnt;
if remainder(cnt,2) = 0 then
crYellow else
crNoColor

Add the same formula for color to the detail section.

-LB
 
Yes, the Group Header and Detail Sections all have suppression in them. I tried adding the formula/background colors in anyway and nothing changed
 
If you are using section suppression, you have to build that into the formula. So what are the formulas you are using for section suppression?

-LB
 
The group header has the following:
if {#rec-count}=0 then true
and each of the 5 detail sections has something like the following:
{DETAIL.UNIT}<>"P"
OR
( {DETAIL.DC}=Previous ({DETAIL.DC}) AND
{DETAIL.TYPE}=Previous ({DETAIL.TYPE}) AND
{DETAIL.ID}=Previous ({DETAIL.ID}) AND
{DETAIL.LOCATION}=Previous ({DETAIL.LOCATION}) AND
{DETAIL.UNIT}=Previous ({DETAIL.UNIT}) )
 
Not sure what the GH running total does, but you would have to make two formulas:

//{@cntgh} to be placed in the group header:
whileprintingrecords;
numbervar cnt;
if {#rec-count} <> 0 then
cnt := cnt + 1;

//{@cntdet} to be placed in the detail section:
whileprintingrecords;
numbervar cnt;
if {DETAIL.UNIT} = "P" and
not (
{DETAIL.DC}=Previous ({DETAIL.DC}) AND
{DETAIL.TYPE}=Previous ({DETAIL.TYPE}) AND
{DETAIL.ID}=Previous ({DETAIL.ID}) AND
{DETAIL.LOCATION}=Previous ({DETAIL.LOCATION}) AND
{DETAIL.UNIT}=Previous ({DETAIL.UNIT})
) then
cnt := cnt + 1;

Then use the following in the section expert->color tab->background->x+2:

whileprintingrecords;
numbervar cnt;
if remainder(cnt,2) = 0 then
crYellow else
crNoColor

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top