frank.py Posted June 1, 2016 Posted June 1, 2016 I’m having trouble with this variable to display the values of my field properly. It is placed in a group header band in a text field that references the variable. Variable expression: $F{type}==("type1")?"Manager":"Employee" The problem is that the expression returns null in the first group, and then just Employee for the rest of the groups, even if the value should be Manager. As a test, if place the Variable down in the details section, that fixes the null problem, but then the ones tat should indicate Manger indicate Employee. My band structure is as follows: Title Page Header Column Header My first group (hidden) My second group header My second group again header –my variable is placed here. My third group (hidden) Details section And so on…… Help appreciated. Thanks, Frank
hozawa Posted June 1, 2016 Posted June 1, 2016 Should usee ".equals()" rather than "==". You're probably getting null in the first group because you haven't provided default value and the variable is calculated after value of the field is calculated.$F{type}.equals("type1")?"Manager":"Employee"
frank.py Posted June 2, 2016 Author Posted June 2, 2016 Hello Hozawa, thanks I see the values being diplayed properly in the details section now with your syntax example, but when I move the variable field to the group header just above the details section, it doesn't work. You mentioned the defaults for the first group, but not sure I will always want to "hard-code" a default for the first iteratiion of group (if that is what you meant).Also, when placed in the group header, Manger is displayed as Employee. So, Im thinking I need to learn how to use the evaluation time options avilable, but not sure the correct combination.Any help appreciated.Thanks,Frank
frank.py Posted June 2, 2016 Author Posted June 2, 2016 Sorry, I was able to use Evaluation Time property and set it to group I wanted and it works fine. Thanks!
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