The attached patch allows to specify a group footer that contains totals for the group. You can print the number of lines for the group, for example, or the sum of a specific column in the format:
<Group footer title>: <total value>
Currently, Dynamic Jasper allows to print totals of columns by group, but the totals are always printed at the bottom of the totalized column. There are situations where this layout does not make sense. For example, if you want to print the number of lines in the group, a better layout would be:
"Number of elements: 50"
This path solves this problem by adding a new method in GroupBuilder for creating the totals for the group.
Method:
setGroupTotal(String totalTitle,String totalOperation,Style style,AbstractColumn column)
Now you can specify the title, operation and style for the group total.
See attached an example of a report with this feature.
Please, see if this patch could be added to the trunk.
Example generated by the patch
Patch for the new functionality
File Added: patch-2383995.txt
I like the approach, but will add the posibility to have many of this lines (one below the other). I'll try to fix the code to have such approach.
Thanks