I think I have it. It vaguely doesn't make sense, but ... (notice, this is my first experience with Jasper Variables, so it was a trial version and an error).
The Variable expression is not quite logical, where the counter type variable does not increment if the expression is false, as you think. The variable increases if there is any value in the expression. So for me, what ended up works below:
$F{on_target} >= 0 ? 1 : null
Note the use of null if the expression should be false.
He makes a vague, twisted meaning. But this is not intuitive. Well, the way it is ...
or in other words:
When you use the Calculation: Count function of a Jasper variable, you need the Variable expression:
- allow non-zero value increment counter
- decide null if you don't want to increment the counter
This is why the test described above works
Scott balmos
source share