-1

I'm trying to print parts of a jasper report conditionally by comparing the parameter supplied value to the value in the field.

However, when I do the comparison the outcome is always FALSE. Both the field and the parameter are INTEGERS. If I compare either of them to an actual number that exists in the dataset, then the outcome is true. Yet, when I supply that same existing number through the parameter for comparison with the field, the outcome is false.

My logic looks like this,

($F{EMPNO}==$P{eno})? "Hello":"Invalid."

Ideally, I expect the word 'Hello' to be printed when the value supplied through the parameter makes the condition true, and 'Invalid' to be printed when the condition is false.

Alex K
  • 21,796
  • 18
  • 106
  • 231

1 Answers1

-1

Try placing Boolean.valueOf infront of your parameter. Boolean.valueOf($F{EMPNO}==$P{eno})? "Hello":"Invalid."

luke.d
  • 1
  • 2