Jump to content

Carryover sums (Subtotal) to next page ?


behlma

Recommended Posts

Hi guys,

I'm looking for some information on the following scenario:

 

I have one big sales table potentially spanning several pages (without groups). At the end of one page I'd like to calculate the subtotal, carry it over to the next page and include it on the calculations on that page.

 

By searching the forums I found out that someone tried exactly that, but I'm still looking for an example/some documentation or hints in that direction.

 

 

Thanks!

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Why not just use a running total? Create a new variable that sum's on a field within each detail line iteration (math equiv $V{total}=$V{total}+$F{detail_line} ). This variable can then be used in the column header or column footer bands. For example:

 

Brought forward xxxx.xx

 

Detail line

Detail line

.

.

.

Detail line

 

Carried forward xxxx.xx

 

Rob

Link to comment
Share on other sites

Well this is something I would be interested too!

 

I already tried some ways, but there is (actually was, as it's more then 2 years ago, when I tried last) one problem:

 

Imaging you have a detail band, that is allowed to split and you have your detail value to sum at the first line in detailband.... following loooooooooooooong text that causes the detail band to split and break to the next page.

 

Now the problem with the carryover-variable is (or was at that time I tried last), that this value is not contained in the current carryover-sum at column-footer variable, because JasperReports seems to calculate the variable when the wholeband is completely drawn and seems not to know if the value to sum is at current page or at next page if the band splits over two pages.

So the LAST value at the pages was always missing if the related band was split to next page and the carry-over was wrong (and so useless).

 

Or is this fixed meanwhile!??!?

 

regards from Germany

C-Box

Post edited by: CBox, at: 2007/07/24 05:52

Link to comment
Share on other sites

Hi guys,

thanks for the input. I'll try out what contentengineer suggested.

 

CBox, have you still got some old code lying around I could take a look at? If so, please send it to behlma@googlemail.com, cheers!

Link to comment
Share on other sites

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...