Tuesday, March 27, 2012

Dynamic RDL group title

I'm new to these forums. If this is not the right place to post this question, please let me know where I should ask. :)

Anyway, I have a report that is grouped something like this:

Team

Location

Score

TEAM 1

#Loc#

#Total#

Home

10

Away

14

Away

8

NULL

0

NULL

0

Home

14

TEAM 2

#Loc#

#Total#

Home

10

Away

14

Home

19

NULL

0

Home

14

TEAM 3

#Loc#

#Total#

Away

7

Away

12

For each team grouping, the header columns needs to perform an action on the grouped records to determine the text.

The #Total# header is easy -- here I want a total of the points ( =Sum(Fields!Points.Value) ). No problem.

The #Loc# header is the problem. What I want to do is to count the number of "Home" values in the group (so Team 1 location reads "Home (2 of 6)", and Team 2 location reads "Home (3 of 5)"). If there are no "Home" values, I want to use the "Away" value (so Team 3 location reads "Away (2 of 2)").

Can someone tell me how I can create a custom code function that will allow me to iterate through the values of the grouped records from the group header textbox? I assume I need to be able to create a custom aggregate function of some kind, but I don't quite know where to begin.

Thanks for your help.

Joe

To simplify the question:

How can I make a group header change to reflect the presence of a specific value from a child row? If I have a group that contains the value "X", how can I change the group header to read "X present"?

No comments:

Post a Comment