Jump to content
Changes to the Jaspersoft community edition download ×

Why does variable with expression that subtracts two other variables always return "null"


hondaman900

Recommended Posts

I have subreports that return and display values in variables in the main report. I have a third variable that subtracts one variable from the other to give a result, but it always gives "null". I have tried all permutations of evaluation time for each variables, and can get the results from the subreports to display no problem but always get null when doing math on them.

My subreports and variables are all in the summary band. The variable doing the math expression is the last item.

The expression that always gives "null" is: 

$V{mon_total}.subtract($V{liabilities_totals})[/code]

where 

$V{mon_total}[/code]

and 

$V{liabilities_totals}[/code]

are the variables that get and display the return values from thre sub reports.

 

Any suggestions where to look next for a solution....?

Link to comment
Share on other sites

  • 2 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Anyone...?   I know it's been a long time, but my work on this project brings me back to the same issue.  The source is 

   `` <variable name="mon_total" class="java.math.BigDecimal"/>
    <variable name="liabilities_totals" class="java.math.BigDecimal"/>
    <variable name="net_worth" class="java.math.BigDecimal" resetType="Page" calculation="Sum">
        <variableExpression><![CDATA[$V{mon_total}.subtract($V{liabilities_totals})]]></variableExpression>
    </variable>``

I can't figure out why this doesn't work??  Any suggestions???

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