JasperServer - null values for input controls

南笙酒味 提交于 2019-12-02 13:40:18

My input controls are multi-select queries and my parameters are collections. I discovered that when I first entered the report by clicking on the link in the Repository, the report was being sent null values. However, when I was trying to run the report again after opening it in JasperServer, I was generating empty lists.

Matthew Dahlman suggested I create parameters in iReport to handle null values and "roll up" my grouping. Those parameters looked like:

 $P{packtype}==null ? " 'All Package Types' " : " FAC.PACKTYPE_CODE " 

That works beautifully in iReport and on first opening the report in JasperServer. To handle an empty list AND null values, I had to change my parameters to:

 $P{packtype} == null ? " 'All Package Types' " :
 ($P{packtype}.isEmpty() ? " 'All Package Types' " :
 " FAC.PACKTYPE_CODE ")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!