masdar Posted July 13, 2009 Share Posted July 13, 2009 I need to put a double variable in my Report where i must calculate (X/1000) in the Variable Wxpression i didn't find any example to help me to do it,, Generaly i would like to know how to do mathimatical praxeis in my Variable. Thanks in AdvancedCode:($F{PROBCID}.equals("3") ? $F{AREADOC}/1000 : "" )// HOW I CAN MAKE THIS CALCULATION $F{AREADOC}/1000Post Edited by masdar at 07/13/2009 10:02 Link to comment Share on other sites More sharing options...
baggypants Posted July 13, 2009 Share Posted July 13, 2009 Either a) chnage your report to use Groovey or b) ($F{PROBCID}.equals("3") ? $F{AREADOC}.divide(new BigDecimal(1000)) : "" ) Link to comment Share on other sites More sharing options...
masdar Posted July 13, 2009 Author Share Posted July 13, 2009 THANK YOU VERY MUCH ,, THE PROBLEM NOW TO CONVERT $F{AREADOC} TO BigDecimali created a new variable new BigDecimal($F{AREADOC}) but it returns NULL Link to comment Share on other sites More sharing options...
baggypants Posted July 14, 2009 Share Posted July 14, 2009 What is AREADOC type initially, Change the new BigDecimal() to match that. e.g. if AREADOC is an integer you can get away with new Integer(1000) ($F{PROBCID}.equals("3") ? $F{AREADOC}.divide(new Integer(1000)) : "" ) Link to comment Share on other sites More sharing options...
masdar Posted July 14, 2009 Author Share Posted July 14, 2009 AREADOC is String and now its work creat a BigDecimal from a String using new BigDecimal("MyString") But i have to check the MyString if it is numeric or not Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now