Jasper reports 如何在ireport中添加Double

Jasper reports 如何在ireport中添加Double,jasper-reports,Jasper Reports,我想做的就是添加两种数据类型的变量。 “$V{iAmt}+V{iFee}” 但错误是“非法使用空值或“空”字面值;”尝试用以下内容填充文本字段: //if your variables are strings: new Double(Double.parseDouble($V{iAmt}) + Double.parseDouble($V{iFee})) //if your variables are already double new Double($V{iAmt} + $V{iFee})

我想做的就是添加两种数据类型的变量。 “$V{iAmt}+V{iFee}”


但错误是“非法使用空值或“空”字面值;”

尝试用以下内容填充文本字段:

//if your variables are strings:
new Double(Double.parseDouble($V{iAmt}) + Double.parseDouble($V{iFee}))

//if your variables are already double
new Double($V{iAmt} + $V{iFee})

// checking nulls
new Double(($V{iAmt} != null ? $V{iAmt} : 0) + ($V{iFee} != null ? $V{iFee} : 0));

你可以试试这样的

  $V{iAmt}.doubleValue() + V{iFee}.doubleValue()

仍然是错误,“类型Double中的方法paseDouble(String)不适用于参数Double”是否有其他方法?@newbie123尝试第二个选项:-)尝试第二个选项,错误再次是“非法使用null值或“null”literal”胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡胡/@newbie123 iAmt和iFee都是双打?是的,顺便说一句,我使用的是ireport 3.0.0