michaelwjoyner Posted May 12, 2013 Share Posted May 12, 2013 For some reason, this expression is causing an error:$F{media_stock_target_price} - $F{media_stock_target_cost} / $F{media_stock_target_price}[/code]THANKS IN ADVANCE!!!Error filling print... Error evaluating expression : Source text : $F{media_stock_target_price}-$F{media_stock_target_cost}/$F{media_stock_target_price}Setting up the file resolver... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{media_stock_target_price}-$F{media_stock_target_cost}/$F{media_stock_target_price} at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:966) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:456) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:440) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:455) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2044) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:639) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:561) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:306) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFille Link to comment Share on other sites More sharing options...
Solution Thomas Zimmer Posted May 12, 2013 Solution Share Posted May 12, 2013 hard to as long you do not give more information... the error says that the expression cannot be evaluated. so, what can be wrong? possibly one of the fields is null? or the field "media_stock_target_price" is zero? (but in this case, as far as I know, you would get a "division by zero" error)check the datatypes and all possible contents of the fields! check the needed datatype of the element the expression is used in (TextField or sth like this?)Cheers, Thomashttp://www.thomaszimmer.net Link to comment Share on other sites More sharing options...
michaelwjoyner Posted May 12, 2013 Author Share Posted May 12, 2013 I did it from the SQL to avoid the problem Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted May 12, 2013 Share Posted May 12, 2013 would be nice for other to describe shortly what the problem was exactly... Link to comment Share on other sites More sharing options...
rsuddhala Posted May 13, 2013 Share Posted May 13, 2013 I think we need to include Parentheses $F{media_stock_target_price} - ($F{media_stock_target_cost} / $F{media_stock_target_price}) Please check it.. 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