Jump to content
Changes to the Jaspersoft community edition download ×

Evaluate value from Map in iReport 2.0 using $V


jaypersanchez_1

Recommended Posts

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.

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...