Jump to content
We've recently updated our Privacy Statement, available here ×

What's wrong?1. Cannot cast from boolean to Object                 value = (java.lang.Object)(((java.lang.String)field_Turbina.getValue()).equals("VO"));//$JR_EXPR_ID=9$


andy_ratiu91

Recommended Posts

I have to do a total count of the values equal to "VO" from a column. I created a variable named: CountV,  class type: java.lang.String, calculation type: Count, expression: $F{Volumetric}.equals("VO").

When i execute it shows: 

Cannot cast from boolean to Object value = (java.lang.Object)(((java.lang.String)field_Turbina.getValue()).equals("VO"));//$JR_EXPR_ID=9$

 

Please help me...i started using IReport for a couple of days and i struggle here...

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

Create a variable, with a "sum" increment function, with datatype Integer. Then, enter "0" as initialization value, choose the right reset and increment triggers and use the following expression as a variable expression :

 $F{Volumetric}.equals("VO")?1:0

And tell us if it works.

 

Regards

François

Link to comment
Share on other sites

Cannot cast from int to Integer value = (java.lang.Integer)(((java.lang.String)field_Volumetric.getValue()).equals("VO")?1:0);//$JR_EXPR_ID=11$  

Cannot cast from int to Integer  value = (java.lang.Integer)(0);//$JR_EXPR_ID=12$

 

----these are the errors shown...

Link to comment
Share on other sites

I couldn't try this because i have another issue:(....when i press execute...in the "Threads" field shows me Compiling report, and 2 seconds after it shows me nothing, no report too...what's happening?? my databse is working fine, i know this because when i took an eye on my querry it showed me the fields i need...Thank you for your interest im my problem:)
Link to comment
Share on other sites

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...