Jump to content
Changes to the Jaspersoft community edition download ×

SubTotals in Report


2004 IR Help

Recommended Posts

By: Horoxxx - horoxxx

SubTotals in Report

2005-04-08 08:13

hi,

 

i have a problem with creating subtotals in my report. I need to create totals for each page on footer and show it, and on last page i do not need to show last page subtotal, but full total sum.

 

i am counting prices...

 

thanks for any help

 

 

 

 

By: Horoxxx - horoxxx

RE: SubTotals in Report

2005-04-12 22:45

so no one can help me please?

 

 

 

 

By: C-Box - c-box

RE: SubTotals in Report

2005-04-12 23:45

Well, I've done something similiar but perhaps something more complex...I tried to sum up all prices and show it at the bottom of that page, on next page the same sum should be shown at the top of the page... then new prices are listed and at the bottom of the new page the new sum should be displayed and so on for each page (kind of "balance brought forward" -->"Uebertrag" in german) but on last page just display the sum at the top and NOT at the bottom because the summary shows the total Sum by itself.

I got to work, to show the sums... but sometimes Jasper breaks the pages irreproducible and the Sum wasn't correct (so the price-element was on page 2 but the subreport stretches to page 3 somehow but dosn't display any elements (so kind of nonsensbreak) and "oops" my sum wasn't correct.) To not show the sum on last page I used the ReportCount-Variable that I used in the PrintWhenExpression and compared with a parameter holding the total row count (summed up before filling --> I'm using CustomDataSources)

 

I got mad while trying this and I commented the lines out in my current reports..... because of the nonsense page-breaks Jasper throws sometimes and so the sums were not correct.

 

So conclusion: kind of horror for me.. but I read on Jasper Homepage that new ResetTypes were introduced.... perhaps so it would be possible

 

hth

C-Box

 

 

 

 

By: Horoxxx - horoxxx

RE: SubTotals in Report

2005-04-12 23:52

thanks for reply, i know it is horror also for me,

 

i am making pretty easy reports, without any subreports and grouping, i am using dynamical SQL query, so i do not know how many rows i will have. Because of this problem, i need to find easy to use sollution, how to make subtotals(count prices for each page). I have put this variable into footer and showing with expression(this page <> total page), but this won`t work :(

 

 

 

 

 

By: C-Box - c-box

RE: SubTotals in Report

2005-04-13 03:09

No the problem is, that the TOTAL_PAGE can only be retrieved by using the $V{PAGE_NUMBER} with evaluation time "report"... so you are using that within one printwhenexpression that alway is interpreted at runtime regardless of any evaluation time (AFAIK).

 

that's why that won't work. But I remember getting to know when last page is curren.... you must put a dummy element (e.g. a white line) in the band "lastpagefooter" where you set a global variable to true within the printwhenexpression... that variable can be used in your other printwhenexpressions.... (when I remember right!)

 

hth

C-Box

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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