hesher Posted July 30, 2009 Share Posted July 30, 2009 Hi,I've been trying to display a table with grouping and to sum up a few statistics for every group. Somethiing a bit like this: --------------------Name Age Heigh(Group Header) First GradeJohn 6 101 BoyLisa 6.2 78 Girl(Group Footer) Number of Kids over 80 Cm Tall: 1(Group Footer) Pie Chart with division to Boys/Girls----------------(Group Header) Second GradeJay 7.1 108 BoyMona 7.2 110 Girl(Group Footer) Number of Kids over 80 Cm Tall: 2(Group Footer) Pie Chart with division to Boys/Girls ---------------------------------So what I don't know how to do is the summary for each group. Is there some way to aggregate data for groups? Thanks again! Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted July 31, 2009 Share Posted July 31, 2009 Good example ;-) Students/classes is my favorite one too...So, for the statistics, create a variable for each statistic, in example for Tall over 80cm:Var name: TALL_OVER_80Calc: SumExpression: $F{Height} > 80 ? 1 : 0Type: IntegerReset type: GroupGroup name: Grades(I'm using groovy to make the expression simpler).Now, suppose you are able to put in two variables using the same idea BOYS and GIRLSCreate a pie chart (you need 2 series, so iReport 3.5.2 is required)Series 1:Key: "BOYS"Value: $V{BOYS}Label: "Boys"Series 2:Key: "GIRLS"Value: $V{GIRLS}Label: "Girls"Chart evaluation time: nowGiulio Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now