Search code examples
jasper-reports

How to setup a jasper report with any length of height?


Say that a jasper report should be generated to a thermal printer. The detail band may be 1 row or 200+ rows.

How to generate jasper report with its height fitting to the row count instead of printing white-spaces in the end?


Solution

  • Set the pageHeight to just one row and then use

    isIgnorePagination="true"
    

    When isIgnorePagination is true the report will be generated in a single page.

    Hence, if just one row, it will have the height of one row, if more rows it will not create new pages but generate a continues layout.

    For example see: http://jasperreports.sourceforge.net/sample.reference/nopagebreak/