cioco87 Posted June 15, 2007 Share Posted June 15, 2007 Good morning, I try to use the method PrintWhen Expression of a band , I use this expression: $F{cdprov_m}=="TV" *****Legend of expression: cdprov_m = table field, type String"TV"= a String ***** Why the compiler like this result --> "Cannot cast boolean to Boolean" ? Please help me. More Thanks.And please ask to my previous topic --> "Ireport Scriptlet". Link to comment Share on other sites More sharing options...
svenn Posted June 15, 2007 Share Posted June 15, 2007 The print when expression requires a Boolean object to be generated. $F{cdprov_m}=="TV" generates a boolean primative. To convert it to a Boolean object do the following new Boolean($F{cdprov_m}=="TV") In addition you need to change the syntax in your statement. You should us ($F{cdprov_m}.equals("TV")) So your final statement should be new Boolean($F{cdprov_m}.equals("TV")) Link to comment Share on other sites More sharing options...
malik.masis Posted December 29, 2016 Share Posted December 29, 2016 change your library 5.x.x and lower with 6.x.x otherwise you don't use methods 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