I need to evaluate a value that I am taking from a Map in ireport. I know that I am retrieving the correct value from within the report. However, I also need to keep track of a number of items per value. For example, I need to keep track of the number of values I get from the Map with values "P"; then I need to keep track on the number of values that are not equals to "P". I am confident that the correct values are being retrieved from the Map and printed on the reports for the correct row.
However, in the summar, I have setup the following variables: nonPValues, PValues.
This is how I am trying to retrieve and evaluate the value:
for keeping count of PValues: ( (String)$P{myMap}.get( $F{myObject}.getObjectValue()) ).equals("P") ? new Integer(1) : new Integer(0)
for keeping count of nonPValues: !( (String)$P{myMap}.get( $F{myObject}.getObjectValue()) ).equals("P") ? new Integer(1) : new Integer(0)
However, when I display the values for each variables, it does not seem to be evaluating correctly. When there are values like "Q" and "H", the PValues gets incremented. I even entered a bogus value that I know does not exist, yet it increments it still. What am I missing?
Thanks for any help.