Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Setting the maximum page length of Itemband

  1. #1
    Join Date
    Sep 2004
    Posts
    10

    Default Setting the maximum page length of Itemband

    Hi all,
    I'm designing a report of an invoice, the report is designed at first with reportdesigner, then the xml of the report (in the extended version) is modified by hands to meet the requirements.

    The problem is to have the report-footer at a fixed position of the page. This can be done simply by adding

    <basic-key name="fixed-position">660</basic-key>

    in the <report-footer>.

    However, doing this, another problem becomes evident. In fact, the Item band can run a bit over the limit of 660, then, if this holds:
    the last page in which the items are shown does not have the report-footer.
    The report footer is placed in the last page of the report, but the items are not present in that page, because the last item is in the previous page.

    This problem is probably due by the fact that items are probably placed before than the report footer (as it is obvious) then, if in the page no more space is left to place the whole report footer, this element is placed in the next page, leading to a page in which only the report footer is present.

    Finally, the question is:
    It is possible to specify a maximum length (height) of the whole itemband, such that in every page of the report, the items cannot be placed over that limit?

    Thank you very much
    Luca

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    There is no way of defining such a maximum height of the usable space. You can define the maximum height of a single itemband instance, but that would not solve your problem here.

    However, you can simply add page-footer that emulates your report-footer behavior. Have a look at the "reportfooter" demo to see such an example. Be aware that this is a hack, and so it may or may not work.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Sep 2004
    Posts
    10

    Default

    Dear Taqua,
    thank you for your prompt reply.
    I searched in the file pentaho-reporting-engine-classic-demo-0.8.10, but I cannot find the "reportfoooter" demo. However, does the hack that you cited consists in displaying the pagefooter only on the last page?
    How it can be done this?

    Thank you again,
    Luca

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    The demo in question is in package org.pentaho.reporting.engine.classic.demo.ancient.demo.reportfooter.

    But just having a page footer that only displays on the last page will not solve your problem, as this still may produce the case where your footer ends up alone on a page or worse may cause layouting errors. So you always have to reserve the space the footer would consume and then you simply show-hide a subband within the footer. The report definitions of that demo contain some explainatory comments in them that explain what actually happens during the layouting and how you hijack that layouting behavior for your own needs.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Sep 2004
    Posts
    10

    Default

    Dear Taqua,
    I'm pleased to inform you that the small hack worked!

    Thank you very much.

    Best Regards
    Luca

    The attached file is the report function I have written to fix the problem. To avoid the white box on the background of the page-footer, I set a fixed height for the footer.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.