I don't want to show message box "The document has no pages" when my Jasper report has no data return (this message box show 3 times so I have to click ok 3 times).
Please help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
There are two ways to fix this:
1. If you're using the iReport designer, you must go from the menu to
Edit > Report Properties
In the dialog there are five tabs. The 'More...' tab is what you're interested in. There at the bottom you see a combo-box called 'when no data'. In it there are all the possible choices that iReport gives you. In my opinion the 'Blank page' is most neutral, if you don't mind having white page in the JRViewer.
2. If you're a geek (or a masochist in this case) and prefer to code your report's source (JRXML) in a text editor, you have to take a look at the attributes of the master tag: <jasperReport> somewhere around line 15-20 you'll find the attribute:
whenNoDataType="NoPages"
which have to be changed to something like:
whenNoDataType="BlankPage"
That's all.
Regards,
jp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't want to show message box "The document has no pages" when my Jasper report has no data return (this message box show 3 times so I have to click ok 3 times).
Please help!
Hi,
There are two ways to fix this:
1. If you're using the iReport designer, you must go from the menu to
Edit > Report Properties
In the dialog there are five tabs. The 'More...' tab is what you're interested in. There at the bottom you see a combo-box called 'when no data'. In it there are all the possible choices that iReport gives you. In my opinion the 'Blank page' is most neutral, if you don't mind having white page in the JRViewer.
2. If you're a geek (or a masochist in this case) and prefer to code your report's source (JRXML) in a text editor, you have to take a look at the attributes of the master tag: <jasperReport> somewhere around line 15-20 you'll find the attribute:
whenNoDataType="NoPages"
which have to be changed to something like:
whenNoDataType="BlankPage"
That's all.
Regards,
jp