Jump to content

multiplication of fields in ireports


swathi.reddys2008

Recommended Posts

Hii

Am trying to multiply the field in ireport 3.7.5. I gave the feild eepression as

"new Double(($F{totallines}.multiply(new java.math.BigDecimal("0.12"))).toString())+new Double(($F{totallines}.multiply(new java.math.BigDecimal("0.024"))).toString())+new Double(($F{totallines}.multiply(new java.math.BigDecimal("0.012"))).toString()+$F{totallines})"

But it genenrating errors .......  "the operator + is undefined for the argument types double,bigdecimal and

"the method multiply(bigdecimal) is undefined for double"

these the issues am facing, can you provide me a solution, please its urjent

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

replace "new Double(($F{totallines}" to new "BigDecimal(($F{totallines}"  in all occurences.
Method multiply   is not applicable  for Double.class,   оnly for BigDecimal.
Which type of field
$F{totallines} ?   If this = java.lang.int, then replace   last $F{totallines}) to Integer.toString($F{totallines)
If this = java.lang.Integer    replace last $F{totallines} to $F{totallines}.toString()
 

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