sudo sudo - 3 months ago 31
Java Question

is there way to print subtotal and total on jasper report?

is there way to print subtotal and total on jasper report in detail band?
I am iterating the field according to dataSource.
The format look like :

Id | Date | Card No | Vehicle No | Amount

1 1/3/2011 ABC1 33493S 39
12/3/2011 40
Total 79

2 2/4/2011 ABC2 34433G 20

Total 20



Total 119


thanks

Answer

Yes.

  1. Create a group (e.g., based on Date).
  2. Create a variable (e.g., subtotal).
  3. Set the Calculation for the variable to: Sum
  4. Set the Reset type to: [Group] Date

This will create a subtotal variable that you can add into the group footer.

Follow the same steps, but set Reset type to Report for the grand total.