1
如何計算地址字段爲空(或任何其他值)的地方有多少行,然後在摘要帶中打印總數?計算字段爲特定值的行數
我試過使用變量,但似乎無法得到它的工作。
- 的JasperServer 5.0.1
- iReport的5.5.0
如何計算地址字段爲空(或任何其他值)的地方有多少行,然後在摘要帶中打印總數?計算字段爲特定值的行數
我試過使用變量,但似乎無法得到它的工作。
添加一個變量具有這些屬性:
Variable class : java.lang.Integer
Caculation : Sum
Reset Type : Report
Increment type : Group
Increment group : YourGroupName
Variable expression : $F{yourField}.equals("") ? 0 : 1
聲明變量$V{countNull}
與屬性:
Variable class = java.lang.Integer
Calculation = Sum
ResetType = Report
Increment type = None
Variable expression = $F{address} != null ? 0 : 1
將$V{countNull}
到摘要頻帶。
把$V{countNull}
代入詳細說明帶看它的計算(用於調試)。
使用' 「」 .equals($ F {} yourField)'以避免潛在的NullPointerException異常。 –