gerald.meachem Posted May 11, 2015 Share Posted May 11, 2015 I have noticed that he built in IF method seems to evaluate both sides of the condition even if it will not be using that particular portion. I am wondering if this is expected behavior? For example: I have an expression IF(FIND("n", $F{CHAR12}) > 0, MID($F{CHAR12}, FIND("n", $F{CHAR12})), "")If there is a carriage return in the string, use the portion of the string after the carriage return. What I get at runtime if there is no line feed in the string is an exception error...Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 This leads me to believe that it is evaluating both sides of the condition and then using one or the other depending on the logical value which obviously doesn't work the way I need it to in this case. Link to comment Share on other sites More sharing options...
hozawa Posted May 12, 2015 Share Posted May 12, 2015 Yes it is.It depends on whether the selected report language is Java or Groovy.I think there's a page in Jaspersoft Studio document about this.http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/tips-tricks#jss-user-variables_3966592960_1024536 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