Jump to content
Changes to the Jaspersoft community edition download ×

Printing percentages

2005 IR Help

Recommended Posts

By: jgslima - jgslima

Printing percentages

2004-11-18 07:13



It seems it's not possible to do that in JasperReports, but I need to print, in each detail line, a percentage, like in:


Product Amount PCT

-------- -------- ----

Car 10 10%

Bike 35 35%

House 55 55%


One could use an expression like 100 * $F{Amount} / $V{TOTAL_AMOUNT}, where TOTAL_AMOUNT is a "Sum" of Amount. But if this is evaluated at "Now" time, $V{TOTAL_AMOUNT} contains only the total until the current line. Otherwise, evaluating that at "Report" time, $F{Amount} contains the amount value of the last line.


Anybody knows a way?


It seems a big, big lack in JasperReports.











By: Gregory A. Swarthout - gswarthout

RE: Printing percentages

2004-11-18 07:42

Precompute the total and pass it in as a parameter.



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