Menu

Remove "The document has no pages" of Jasper

Developers
vinhpt
2008-05-06
2013-03-08
  • vinhpt

    vinhpt - 2008-05-06

    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!

     
    • Ivan Popov

      Ivan Popov - 2008-05-08

      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

       

Log in to post a comment.