Hello everyone
I’m a little desperate. I try to sum up the number of yes and no that there is in my transport stop table that is in database and I do not understand what is wrong with it.
I created a variable configured this way:
name value class: java.lang.integer
calculation: sum
expression:IF($F{arret_dorm} ="Non",1,0)
intimate value expression: 0
increment type: none
type réinitialisatio common group
and then I put this variable in the header detail, knowing that I have a band.
The problem is that it always appears 0 as a value. If I set 1 to the initial value, it remains 0.
I’m not sure what to do any help will be welcome
2 Answers:
Hello,
You can try using compareTo() function this function accepts string and if it matches to provided string then it will return 0.
so you can try using expression something like below and set true value as 1.
IF($F{arret_dorm}.compareTo( "Yes")==0,1,0)
Hopefully this will help you.