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

alternate background color for groups 1

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I searched few threads and could't find anything that could help me fix this problem.
I have only five groups in my report. If I am using this function:
if remainder(groupnumber,2)=0 then silver else yellow
then it is just coloring every group with yellow.
The GroupNumber value is returned as 1,3,5,7,and 9 for each group.

Any idea what am I doning wrong here?
Thanks,
 
This looks like you have some suppressed groups--otherwise your groupnumbers would be sequential. Go to format section->group header->suppress and check for a suppression formula. Then instead of using groupnumber in your color formatting formula, use {#cntgrps} where {#cntgrps} is a running total (using the running total editor) using a distinct count of the group field, evaluate based on a formula (enter the opposite of your group suppression criteria), reset never or on change of a higher order group, depending on your report design.

-LB
 
Try this

In report header place this formula suppressed

//@ShadingFlagInitial

WhilePrintingRecords;
BooleanVar Flag := False;

In a suppressed (B) section of the Group footer place this formula

//@ResetFlag

WhilePrintingRecords;
BooleanVar Flag ;

Not Flag;

Now in all the sections where you want color change in the section expert formula for section color put the formula

WhilePrintingRecords;
BooleanVar Flag ;

if Flag then silver else yellow;

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
hmmmm...didn't think of suppressed groups....if so...how are you suppressing them

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Nope, I am not supressing any groups. The report only returns five groups based upon a view. Also each group has a subgroup which I am supressing.
 
You could also create a formula to initialze a variable

GroupColor

Set this variable to 0

the in the the group create another formula @GroupColorIncrement.

In this formula increment GroupColor by 1.

In the Color section of Format Section

write this formula

If Shared NumberVar GroupColor Mod 2 = 0 then crSilver else crYellow

 
Your groupnumber indicates that something is interfering with the count, so try the running total solution. Add a running total to the group header and let us know what values it is returning.

-LB
 
sorry guys. I am supressing the group footer section, which is counting also. i tried Ngolem's solution and still getting the same problem, yellow for all groups.
Let me try BobMarleys' tip.
 
Cool. BobMarley's solution works!
Thank you all for your helpful tips and suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top