Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 707
Manu Avatar asked Feb 26 '23 05:02

Manu


2 Answers

$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)
like image 120
Gordon Avatar answered Mar 11 '23 08:03

Gordon


Guess you can try this out -

$V{strloanNo}.floatValue()/$V{loanCalculation}.floatValue() 
like image 25
Sachin Shanbhag Avatar answered Mar 11 '23 08:03

Sachin Shanbhag