gi-spot Posted May 9, 2011 Share Posted May 9, 2011 I solved my main trouble. Now the last one: I have a string which represents a number (cost of a component). I need to use this cost for calculating something else. How can I convert a string to double for using in a textfield expression?Thank you all.... Link to comment Share on other sites More sharing options...
kolaitis Posted May 10, 2011 Share Posted May 10, 2011 Expressionnew Double(Double.parseDouble(yourField or variable))Exp.class java.lang.Double Link to comment Share on other sites More sharing options...
gi-spot Posted May 10, 2011 Author Share Posted May 10, 2011 Thanks a lot: I'm beginning to understand something about. Expression you posted to me seemed to work fine in ireport, but when I try to compile the report in "invoicex" it returns to me the error:net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression: Source text: new Double(Double.parseDouble($F{importo})).Procession Timing? A "null" string? Any idea? I'm going slightly mad...but thanks in advance to everybody will help me. Post Edited by gi-spot at 05/10/2011 20:02 Link to comment Share on other sites More sharing options...
gi-spot Posted May 14, 2011 Author Share Posted May 14, 2011 There's nobody talkin' at me, I don't hear the words they're saying, only the echo of my mind....:-Anybody could give a little help, please? Link to comment Share on other sites More sharing options...
gail26 Posted May 14, 2011 Share Posted May 14, 2011 You can use short-hand conditional statement.SYNTAX:( <condition> ? exp1 : exp2 ) variable will return exp1 if condition is true, else exp2 will be returned.it is likeif(<condition>){ exp1}else{ exp2} GoodLuck 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