How do I hide a table that has no data on ireport?

穿精又带淫゛_ 提交于 2019-12-11 13:05:15

问题


How do I hide a table (not include in layout) that has no data?


回答1:


If you have the table on its own band, what I typically do is set a print when condition on the band that only shows the data if any object in that band has data. Say your table is something like this:

item1 item2 item3

The print when expression would look something like this:

item1 != null || item2 != null || item3 != null

If you're referring to a subreport built using a collection, then I just check to make sure the collection isn't empty:

!subreportCollection.isEmpty()

Putting the print when condition on the band line hides the data, and causes the report to collapse the unused space.



来源:https://stackoverflow.com/questions/5649350/how-do-i-hide-a-table-that-has-no-data-on-ireport

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!