"Data not found." text in jasper report

I would like to make a report using iReport, which can, but should not display rows. How to make Jasper Reports display the text "No data". when the query returns no data. I would like to have the same title as with the rows.

I know that I have to change the property of the report "When there is no data" to display something, but I do not know how to implement the condition without rows.

+4
source share
1 answer

I found it myself.

This can be done by following these steps:

  • Add the “ No Data ” section from the list of sections in the “ Report Inspector ” section. Right-click and select " Add Band ". After that, a new section will be added to your report.
  • Add any content to a newly added section, for example. " No Data found ." (if you need the same header as in the "normal" report, you must copy it from the "Header" section to the " No Data " section).

If you do not have the " When No Data " report property set to the " No Data Section ", set it like this or follow these steps:

  • Display a report property by right-clicking on the report and selecting " Properties " in the displayed menu.
  • Find the " More... " section and in it you will see the property "When there is no data", change it to " No Data Section ".

After doing the above, your report will display the " No Data " section when there is no data, otherwise it will show the section as before.

+14
source

All Articles