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

cumulative amount per row


mortoza

Recommended Posts

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

Top Posters In This Topic

Assuming that you group by Customer, you can simply use a summing variable, like this:

 

 

Code:
	<variable name="mySum" class="java.lang.Double" resetType="Group" resetGroup="Customer" calculation="Sum">
<variableExpression><![CDATA[new java.lang.Double($F{Purchase}.doubleValue() + $F{Payment}.doubleValue() )]]></variableExpression>
<initialValueExpression><![CDATA[new java.lang.Double(0)]]></initialValueExpression>
</variable>

 

 

 

The TextField Expression for your running sum's textbox will then simply be the variable name (eg. $V{mySum} )

 

 

.

Post edited by: jmurray, at: 2007/01/04 01:06

Link to comment
Share on other sites

Hi jmurray

It is only working for the current row. Please see the report (pdf).

I want the balance should be cumulative of previous and current rows in each row.

 

Can anyone help?

 

Mortoza [file name=statement-e4d480bbce44c69aa58834846a90be5f.pdf size=2197]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/statement-e4d480bbce44c69aa58834846a90be5f.pdf[/file]

Link to comment
Share on other sites

Essentially no because all the data is hardcoded into the query, BUT you will need a valid Oracle or mySQL database connection available before it will work.

 

Alternatively you can provide your own data source. Enough sppon feeding for now. Have fun.

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