Jump to content
Changes to the Jaspersoft community edition download ×

Running Percentages


gan

Recommended Posts

I am trying to build a report with running percentage.

A "sum" variable evaluated "now" will effectively calculate a running sum of a field. The same variable, evaluated "report" will provide the total sum. How can I divide the running sum with the total sum, i.e. calculate and display the running percentage?

 

I am including an example report.

[file name=RunPerc-c837e9154419bf47250c4e8bb940853a.jrxml size=12551]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/RunPerc-c837e9154419bf47250c4e8bb940853a.jrxml[/file]

 

Thanks in advance for the help.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can achieve this using Auto evaluation type for the text field. As Auto uses the variable's reset type to determine its evaluation time, you'll have to copy the value of the sum variable into a variable having resetType="None" to use it as the current sum value.

 

I'm attaching a simple report illustrating this. Fill it with new JREmptyDataSource(10) to see the result.

 

HTH,

Lucian [file name=runningPercentage.jrxml size=2077]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/runningPercentage.jrxml[/file]

Link to comment
Share on other sites

  • 1 year later...

Lucianc,

Thank you for the jrxml example. That's exactly the sort of help that I needed to get to grips with running percentages. I have been through all the Admin and Ultimate guides and this was the thing that solved it for me.

 

Much appreciated.

 

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