For some reason, this expression is causing an error:
$F{media_stock_target_price} - $F{media_stock_target_cost} / $F{media_stock_target_price}
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
1 Answer:
Posted on May 11, 2013 at 11:10pm
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, Thomas
I did it from the SQL to avoid the problem
would be nice for other to describe shortly what the problem was exactly...
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..