vspn Posted October 22, 2014 Posted October 22, 2014 I have two variable $V{SUM_ITEMS_SHIPPED} and $V{SUBREP_COUNT} I want sum of these two variables using Groovy. For this, I dragged a new text field to summary band and in the "Text Field Expression" i have given as $V{SUM_ITEMS_SHIPPED} +$V{SUBREP_COUNT} But the result of this concatenation of these two values and not the sum. For ex: $V{SUM_ITEMS_SHIPPED} = 1 $V{SUBREP_COUNT} = 0 output is "10" and not "1" Please help me how to do this. What "Text Field Expression" is needed to sum these two variables together ?
hozawa Posted October 22, 2014 Posted October 22, 2014 Select your variable and look at it's property. By default, variables are created as String. Change the "Value Class Name" to something like "java.lang.Integer".
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