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 on more than one group 1

Status
Not open for further replies.

traveller4

Programmer
Sep 18, 2002
62
0
0
CA
I have a report where the shading is working like it should. This report only has one grouping level which is "FileName". Now I have to have a secondary grouping level called "PersonName". When I add this grouping level the shading goes sideways.

I am trying to shade in every other FileName/PersonName grouping

Before I added the PersonName field I was using this formula to conditionally format the shading

iif(groupnumber mod 2 = 0,Color (228, 228, 228),crWhite)

Needless to say I am at a loss.

Any help at this point would be greatly appreciated.

Thanks in advance
 
I'm not sure what "shading goes sideways" means, but if you want shading on every other "PersonName" group, move your formula to the PersonName group. If you are after something else, please explain more.
MrBill
 
Mr Bill

Sorry for the shading goes sideways" comment I should be more discriptive of the problem than annoyed by it.

What I am after is a way to shade the parentgroup filename and its child personname as one area and then have the next set parentgroup filename and its child personname as not shaded area.

As it sits now I get the first filename shaded and then the second personname shaded where I want the two groups shaded as one

Thanks again for your quick response
 
Try setting a variable in your group header 1 formula indicating if the color is white or silver:

WhilePrintingRecords;
StringVar SilverWhite;
If groupnumber mod 2 = 0 then
SilverWhite:= "S" else
SilverWhite:= "W";
iif(groupnumber mod 2 = 0,Color (228, 228, 228),crWhite)

In the color formula for the child group enter the following formula:

WhilePrintingRecords;
StringVar SilverWhite;

If SilverWhite = "S" then
Color (228, 228, 228) else
crWhite

I tried this and it worked for the most part. For some reason there were a couple of instances where the color did not change, maybe because I was using groups 2 and 3 instead of groups 1 and 2.

MrBill
 
After more testing I discovered that the special field GroupNumber was not counting the groups at each group level so I had to create a formula to do that:

WhilePrintingRecords;
NumberVar GrpNum;
GrpNum:=GrpNum + 1

I then use the formula field to replace the GroupNumber field in my background group color formula.

MrBill
 
MrBill

Thank you so very much for all your help. The GrpNum was the key. It work perfectly. If I could give you more than one star I would

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top