2012-07-29 144 views
2

我尝试在Jasper中计算表达式时出现问题。 运行报告后显示错误消息。如何在Jasper报表中计算分割和相乘?

Error filling print... Error evaluating expression :      Source text : new Integer(($F{total_answer}.intValue()) / ($F{total_max_score}.intValue()*100)) 
Can't find the translation for key = time_picker: using default (Time)  Can't find the translation for key = time_picker: using default (Time)  For input string: ""  For input string: ""  java.lang.ArithmeticException: / by zero  

这是我的代码:

new Integer(($F{total_answer}.intValue())/($F{total_max_score}.intValue()*100)) 

任何人都知道这件事吗?

+0

您是否检查过'$ F {total_max_score}'0和空值? – 2012-07-30 10:06:23

+0

似乎你正在使用的表达式被零除。你只使用这个吗? – 2012-07-30 10:50:19

回答