How to give condition for null values of multi select parameter in Ireport?

╄→尐↘猪︶ㄣ 提交于 2019-12-02 07:48:23

The $X feature handles this automatically. In your case you have this in your query:

$X{IN, country, p_country}

That gets converted to 1 = 1 in the case where your Collection is null. So there is no reason to add $P{p_country} is null into the query.

harish babul

When the value of Collection parameter is NULL then to hide all the data output is done by bellow print when expression on table component.

P{Collection_Parameter_Name}.size()>0

notes:

  1. Collection parameter takes the syntax $X{IN,filed_Name,param_Name} in SQL query but here we have to take it as $P{Collection_parameter_Name}
  2. If you print parameter on the report you will get different sizes of the collection parameter (Number of selected values in collection drop down)

You could put your condition like this city IN ($P!{p_city})

Then you could call by the url with:

http://ip:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=/reports/reports&reportUnit=/reports/reports/rptReporte&j_username=jasperreportadmin&j_password=jasperreportadmin&p_city='city1','city2'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!