Jump to content
We've recently updated our Privacy Statement, available here ×

Subtotal group


mtn
Go to solution Solved by mtn,

Recommended Posts

Hi,

Can someone help me realizing the following.

My data is grouped. Now when the detail lines for a group goes beyond a page the total of all the lines belonging to that group must be shown on top of the following rows on the next page. So more schematically I’m trying to realize the following:

--------------
Page 1
Group A
Detail line 1    amount
Detail line 2    amount
Detail line 3    amount
Detail line 4    amount
Total for group A
Group B
Detail line 1    amount
Detail line 2    amount
--------------
Page 2
Total amount for group B on the previous page (line 1 and 2 in group B)
Detail line 3    amount
Detail line 4    amount
Total for group B

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

After a lot of searching, trail and error I came to the following solution. 

1. Place the fields in the relevant group header. Set the reprint
    header on each page to true.
2. Create a variable with 
    - calculation sum  
    - expression: field you which to sum 
    - initial value expression java.math.BigDecimal.ZERO 
    - Increment type none
    - Increment factory class: (leave empty)
    - Reset type relevant group
4. Add this variable to a text field with evaluation time now.

Voila. Once again this solution seems to work but  there was/is a lot of trail and error in finding a solution.
 

Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...