I have a column in my database, which is the ColorCode column (Field name $F{COLORCODE} ) that has values like 'B' and 'R' and 'G', I want to count the amount of them respectively to their color.
So I have variables called countBlue, the variables expression is $F{COLORCODE}=='B' and put it in the Column Footer but the report counted everything including the R and G in that column, did I do the comparison statement wrongly?
also I have set up my countBlue variable class to java.lang.Integer, calculation as Count and reset type as Report
p/s sorry for bad english
Best Answer
You can use this expression (Calculation: Count; Reset type: Report; Increment type: None):
or this (Calculation: Nothing; Reset type: Report; Increment type: None):
You can read about variables here.
The JasperReports Ultimate Guide says: