How to use divide () method in jasper reports?

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

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

I need to separate both variables, but I am not getting the expected result. it displays a "zero" value.

any idea guys?

+3
source share
3 answers
$V{x}.divide( $V{y} )

This works for me.

It looks like your variables are Null.

Be sure to set the expression of the original value in the properties of the variables.

I set both of mine below.

new java.math.BigDecimal(10.0)
+5
source

Guess you can try this -

$V{strloanNo}.floatValue()/$V{loanCalculation}.floatValue() 
+2
source
$F{Attribute_a}.divide($F{Attribute_b})

java.math.BigDecimal

b ,

0

Source: https://habr.com/ru/post/1764908/


All Articles