Search code examples
sumjasper-reportseach

Jasper report sum of each group item


I am using Jasper Report 4.5
My problem is I have list of employees and its monthly tax deduction.

I need the report in which it shows employees tax deduction group by monthly and in bottom it should display total(sum of) tax deduction of each employee.


Solution

  • Here is one way you can do it.

    1. Order the resultset by month, then by employee.
    2. Create level 1 report group, group1, which groups by month and a level 2 group, group2, that groups by employee.
    3. Create a sum variable that resets on group1.
    4. Print the sum in the trailer of group2.