ethereal_robe Posted February 18, 2014 Share Posted February 18, 2014 I want a textfield to be visible only when a condition is met, so I clicked on "print when expression" button and pull a field called "$F{state}". That state gets a string. What I want to do is catch when state = sent to make the textfield appear. I tried doing the following:$F{Estado-state} = sentbut it does not work, I need help finishing this expression.The error I get when trying to generate a report is as follows:Report ErrorFailed to invoke method execute in class com.nantic.jasperreports.JasperServer: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_Cotizaciones_1392769053109_320557: 817: class org.codehaus.groovy.ast.expr.CastExpression, with its value '(java.lang.String) field_Estado45state.getValue()', is a bad expression as the left hand side of an assignment operator at line: 817 column: 92. File: calculator_Cotizaciones_1392769053109_320557 @ line 817, column 92. 1 error Link to comment Share on other sites More sharing options...
olivfsk Posted February 20, 2014 Share Posted February 20, 2014 Hi,Your syntax seems to be wrong. With Groovy you can write :$F{Estado-state} == "sent"[/code]Hope its help...Bye Link to comment Share on other sites More sharing options...
ethereal_robe Posted February 20, 2014 Author Share Posted February 20, 2014 I actually found the cporrect syntax, I will post it as an answer. Link to comment Share on other sites More sharing options...
ethereal_robe Posted February 20, 2014 Author Share Posted February 20, 2014 This is what worked for me. $F{Estado-state}.equals("progress") ? Boolean.TRUE : Boolean.FALSE 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