I would like to do the report using iReport which can but does not have to display rows. How can I force Jasper Reports to display the text "No data found." when the query returns no data. I would like to have the same header as when there are rows.
I know I should change the report property "When No Data" to display something but I don't know how to implement the condition for no rows.
I have found it out myself.
This could be done by following these steps:
No Data
" section from the sections list in the "Report Inspector
". Right click it and choose "Add Band
". After this, new section will be added to your report.No Data found
." message (if you would like the same header as in "normal" report, you have to copy it from the "Header" section to "No Data
" section).If you don't have the report property "When No Data
" set to "No Data Section
" set it so or follow these steps:
Properties
" from the displayed menu.More...
" and in it you will see "When No Data" property, change it to "No Data Section
".After following the above, your report will show the "No Data
" section when there will be no data, oterwise it will show the section as before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With