Search code examples
jasper-reports

how to use divide() method in jasper reports?


Im using iReport1.3.3 tool to create pdf and xls template .. My problem is for the below expression,

     ($V{strloanNo}).divide($V{loanCalculation})

i need to divide both the variables but i am not getting expected result. it is displaying "null" value .

any idea guys?


Solution

  • $V{x}.divide( $V{y} )
    

    This works for me.

    It looks like your variables are Null.

    Make sure to set the Initial Value Expression in the variable's properties.

    I set both of mine to below.

    new java.math.BigDecimal(10.0)