andy_ratiu91 Posted February 28, 2014 Share Posted February 28, 2014 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 More sharing options...
fcerbell Posted February 28, 2014 Share Posted February 28, 2014 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:0And tell us if it works. RegardsFrançois Link to comment Share on other sites More sharing options...
andy_ratiu91 Posted February 28, 2014 Author Share Posted February 28, 2014 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 More sharing options...
fcerbell Posted February 28, 2014 Share Posted February 28, 2014 As found here : http://community.jaspersoft.com/questions/525053/cannot-cast-int-integercoud you try : new Integer($F{Volumetric}.equals("VO")?1:0 ) Link to comment Share on other sites More sharing options...
andy_ratiu91 Posted March 3, 2014 Author Share Posted March 3, 2014 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 More sharing options...
fcerbell Posted March 3, 2014 Share Posted March 3, 2014 Hi, It is another issue, it has to be another thread. Regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now