Monday, March 19, 2012

Group Header Alternating color

I am trying to get alternating colors on group headers.

The rownumber() doesn't work; that only seems to be the count of rows in the group.

Does anyone have any great ideas for this?

Thanks!

BobP

Have you tried CountDistinct(<group expression fields>)?|||

Yes, I get a "1" for each group header row.

I have also tried countrows.

BobP

|||I realize this was a year ago, but was wondering if anyone had figured out a solution. I am trying to alternate colors at the group level and am not having any luck...
|||

If I understand you correctly, this should give you the desired result:

Add this to your code window:

Code Snippet

Dim numFooterRow as Double

Function GetRowNumber() as Double
numFooterRow += 1
Return numFooterRow
End Function

Add a new column to the table and mark it as not visible. On the group header row (the invisible column), add this expression:

Code Snippet

=Code.GetRowNumber()

You will need the name of the textbox that you just entered the expression into for the final part. In the header row background color add the following expression:

Code Snippet

=iif(ReportItems!textbox18.Value Mod 2 = 0,"LightCoral","RosyBrown")

You now have alternating colors at the group header level.

Simone

|||Wow, thanks so much, Simone! I've been banging my head against the wall on this one for the last hour, trying to think up ways to do it in SQL, using the Previous() function, etc. This worked like a charm!
|||I am trying to do something where I say look through the row. When you come across the word "Start" color that box green and color all other boxes to the right in that row green as well until you come upon the word "stop". Is this possible? If I am not making sense just let me know and I will try to explain better. Thanks in advance for any help that I get.|||You might want to start a new thread, although somewhat similar, it seems to me its a different topic...|||Ok will do.

No comments:

Post a Comment