Jump to content
Changes to the Jaspersoft community edition download ×


Recommended Posts

By: Karwan Salih - salihk


2002-10-24 13:01


I've created a one-page report that has several fields with Double values retreived from the database. Is it possible to create a variable that holds the summation of those fields at the end of the page? Each page represents one record in the RecordSet.








By: Teodor Danciu - teodord

RE: Variable=Sum(Fields)?

2002-10-27 13:11




Your variable should look like this:


<variable name="MySumVariable" class="java.lang.Double" resetType="Page" calculation="Sum">


new Double(

$F{MyField1}.doubleValue() +

$F{MyField2}.doubleValue() +

$F{MyField3}.doubleValue() +






If you have only one record per page anyway,

the "resetType" and "calculation" attributes

could be left to their default values: "Report" and "Nothing".


I hope this helps.


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