Search code examples
jasper-reportssubtotal

Jasper Subtotal


I have a report- from another question: Jasper report data summary which shows totals for a number of columns by location. I need to sub-total some of the location_cds and am not sure where to start. I have one group - by location_cd. Some location_cds have sub-locations, i.e. 3A has 3A1, 3A2, 3A3. Right now I have the totals for each individual row displayed in the group footer. I would like to see a subtotal for any location_cd that has sub-locations. I am trying to puzzle out how I am going to approach that. Should I see if I can do that in the query or will Jasper help me out here?

I am querying Sybase ASE 15.7.0 and am using Jasper Studio 5.5.1


Solution

  • Sub totals are the same as totals, just check the following:

    1. add the order by corresponding to your list - usually add the item to the order by list

      ORDER BY some_name_wharever, my_subtotal_thing_to_be_ordered

    2. create a new group using the wizard, right click the root of the report on the report inspector and select "add report group"

    3. create a new variable just like the total one but mind the reset and increment group

    That should do it. Hope it helps. Good luck.