Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Items overlapping pagefooter

  1. #1

    Default Items overlapping pagefooter

    Hi,

    I'm currently using JFreeReport 0.8.7 with a very simple java implementation to generate invoices. Everything works fine except when I have an invoice with 16 or 17 details. Those details will overlap with my pagefooter and JFreeReport doesn't put them on a new page. It seems he just looks if all the details fit on one page and then print them on one page and doesn't take the footer into consideration, so they both interfere and mix up. When I have an invoice with 18 details for example, he does the thing correctly and prints 15 details on the first page and the remaining 3 on the second page and it all looks good...

    Below you find the xml from my details and footer... Anyone any ideas ? Thanks alot in advance...

    Code:
    <!-- Sale details -->
    
    <items> <string-field x="0" y="2" width="70" height="13" alignment="left" fieldname="product.productCode"/> <string-field x="75" y="2" width="225" height="13" alignment="left" fieldname="product.description"/> <number-field x="305" y="2" width="35" height="13" alignment="right" fieldname="detail.qty"/> <number-field x="350" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.amountPrice"/> <number-field x="410" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.vatPercentage"/> <number-field x="470" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.amountIncl"/> <string-field x="55" y="15" width="225" height="13" alignment="left" fieldname="action.description"/> </items>
    <!-- Page footer --> <pagefooter fontname="SansSerif" fontstyle="bold" fontsize="12"> <line name="line.footer" x1="0" y1="0" x2="530" y2="0" weight="0.5"/>
    <!-- Payment details --> <string-field x="200" y="2" width="120" height="40" alignment="left" fieldname="paymentTotals.labels" /> <string-field x="320" y="2" width="5" height="40" alignment="left" fieldname="paymentTotals.labelcolons" /> <string-field x="325" y="2" width="100" height="40" alignment="right" fieldname="paymentTotals.mvh" /> <string-field x="425" y="2" width="100" height="40" alignment="right" fieldname="paymentTotals.amounts" />
    <!-- Company Address --> <string-field name="company.nameExpression" fieldname="company.nameExpression" fontsize="9" x="10" y="2" fontstyle="plain" width="200" height="12" alignment="left"/> <string-field name="company.addressExpression" fieldname="company.addressExpression" fontsize="9" x="10" y="12" fontstyle="plain" width="200" height="12" alignment="left"/> <string-field name="company.cityExpression" fieldname="company.cityExpression" fontsize="9" x="10" y="22" fontstyle="plain" width="200" height="12" alignment="left"/>
    <!-- Conditions --> <string-field x="0" y="46" width="530" height="20" fontsize="9" alignment="center" fieldname="factend" fontstyle="plain"/>
    </pagefooter>

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

    Default

    Do you have any fancy "group-footer" hiding in your report? If you post the complete report definition, at least I can start guessing.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3

    Default

    Here is my complete report definition (I'll post it in 3 times, since it is to big for 1 post). As you can see no group footer or anything special. Just very basic...

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    
    <report name="Invoice" pageformat="A4" topmargin="20" leftmargin="30" bottommargin="40" rightmargin="30">
    <!-- Configuration -->
    <configuration> <property name="org.jfree.report.modules.output.pageable.pdf.Encoding">Identity-H</property> <property name="org.jfree.report.modules.output.pageable.pdf.EmbedFonts">true</property> </configuration>
    <!-- Pageheader -->
    <pageheader fontname="SansSerif" fontstyle="plain" fontsize="11" pagebreak-before-print="true">
    <!-- Company logo -->
    <image-field x="0" y="24" width="290" height="124" fieldname="company.logo" name="logo" dynamic="false" scale="true" keepAspectRatio="true"/>
    <!-- Company information -->
    <string-field name="shop.nameExpression" fieldname="shop.nameExpression" x="325" y="25" width="200" height="12" alignment="left"/> <string-field name="shop.addressExpression" fieldname="shop.addressExpression" x="325" y="37" width="200" height="12" alignment="left"/> <string-field name="shop.cityExpression" fieldname="shop.cityExpression" x="325" y="49" width="200" height="12" alignment="left"/> <string-field name="shop.telExpression" fieldname="shop.telExpression" x="325" y="61" width="200" height="12" alignment="left"/> <string-field name="shop.faxExpression" fieldname="shop.faxExpression" x="325" y="73" width="200" height="12" alignment="left"/> <string-field name="shop.vatExpression" fieldname="shop.vatExpression" x="325" y="85" width="200" height="12" alignment="left"/> <string-field name="shop.rprExpression" fieldname="shop.rprExpression" x="325" y="97" width="200" height="12" alignment="left"/>
    <!-- Page Title -->
    <string-field x="0" y="140" width="530" height="45" alignment="center" fieldname="facttitle" fontsize="16" fontstyle="bold"/>
    <!-- Customer information -->
    <string-field name="customer.nameExpression" fieldname="customer.nameExpression" x="0" y="185" width="250" height="12" alignment="left"/> <string-field name="customer.addressExpression" fieldname="customer.addressExpression" x="0" y="197" width="200" height="12" alignment="left"/> <string-field name="customer.cityExpression" fieldname="customer.cityExpression" x="0" y="209" width="200" height="12" alignment="left"/> <string-field name="customer.countryExpression" fieldname="customer.countryExpression" x="0" y="221" width="200" height="12" alignment="left"/> <string-field name="customer.paymenttypeExpression" fieldname="customer.paymenttypeExpression" x="230" y="185" width="300" height="12" alignment="right"/>

  4. #4

    Default

    Code:
    <!-- Number of pages information --> <string-field x="325" y="221" width="39" height="13" fieldname="pagina" alignment="right" fsitalic="true"/> <string-field x="365" y="221" width="30" height="13" fieldname="PAGE_N_OF_M" alignment="right" fsitalic="true"/>
    <!-- Invoice header data --> <rectangle x="0" y="237" width="100%" height="35" draw="true" fill="false"/> <string-field x="3" y="240" width="100" height="13" alignment="left" fieldname="factnr" /> <string-field x="50" y="240" width="140" height="13" alignment="left" fieldname="header.number"/> <string-field x="3" y="257" width="100" height="13" alignment="left" fieldname="bankaccount" /> <string-field x="90" y="257" width="125" height="13" alignment="left" fieldname="shop.bankAccount"/> <line x1="190" y1="237" x2="190" y2="272"/>
    <string-field x="193" y="240" width="75" height="13" alignment="left" fieldname="datum"/> <date-field x="270" y="240" width="94" height="13" alignment="left" fieldname="header.date" format="dd-MM-yyyy" /> <string-field x="193" y="257" width="75" height="13" alignment="left" fieldname="vervaldatum"/> <string-field x="270" y="257" width="94" height="13" alignment="left" fieldname="header.expirydate" /> <line x1="347" y1="237" x2="347" y2="272"/>
    <string-field x="350" y="240" width="78" height="13" alignment="left" fieldname="klantnr" /> <string-field x="427" y="240" width="105" height="13" alignment="left" fieldname="customer.keyCode"/> <string-field x="350" y="257" width="78" height="13" alignment="left" fieldname="btwnr" /> <string-field x="427" y="257" width="105" height="13" alignment="left" fieldname="customer.vatNumber"/>
    <!-- Column headers --> <string-field name="product.productCode" x="0" y="287" width="70" height="12" alignment="left" fieldname="code"/> <string-field name="product.description" x="75" y="287" width="225" height="12" alignment="left" fieldname="omschrijving"/> <string-field name="detail.qty" x="305" y="287" width="35" height="12" alignment="right" fieldname="aantal"/> <string-field name="detail.amountPriceGross" x="350" y="287" width="50" height="12" alignment="right" fieldname="prijs" /> <string-field name="detail.vatPercentage" x="410" y="287" width="50" height="12" alignment="right" fieldname="btw"/> <string-field name="detail.amountIncl" x="470" y="287" width="50" height="12" alignment="right" fieldname="totaal"/> <line name="line.end" x1="0" y1="302" x2="530" y2="302" weight="0.5"/> </pageheader>

  5. #5

    Default

    Code:
    <!-- Sale details --> <items layout-cachable="false"> <string-field x="0" y="2" width="70" height="13" alignment="left" fieldname="product.productCode"/> <string-field x="75" y="2" width="225" height="13" alignment="left" fieldname="product.description"/> <number-field x="305" y="2" width="35" height="13" alignment="right" fieldname="detail.qty"/> <number-field x="350" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.amountPrice"/> <number-field x="410" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.vatPercentage"/> <number-field x="470" y="2" width="50" height="13" alignment="right" format="0.00" fieldname="detail.amountIncl"/> <string-field x="55" y="15" width="225" height="13" alignment="left" fieldname="action.description"/> </items>
    <!-- Page footer --> <pagefooter fontname="SansSerif" fontstyle="bold" fontsize="12" > <line name="line.footer" x1="0" y1="0" x2="530" y2="0" weight="0.5"/>
    <!-- Payment details --> <string-field x="200" y="2" width="120" height="80" alignment="left" fieldname="paymentTotals.labels" /> <string-field x="320" y="2" width="5" height="80" alignment="left" fieldname="paymentTotals.labelcolons" /> <string-field x="325" y="2" width="100" height="80" alignment="right" fieldname="paymentTotals.mvh" /> <string-field x="425" y="2" width="100" height="80" alignment="right" fieldname="paymentTotals.amounts" />
    <!-- Company Address --> <string-field name="company.nameExpression" fieldname="company.nameExpression" fontsize="9" x="10" y="2" fontstyle="plain" width="200" height="12" alignment="left"/> <string-field name="company.addressExpression" fieldname="company.addressExpression" fontsize="9" x="10" y="12" fontstyle="plain" width="200" height="12" alignment="left"/> <string-field name="company.cityExpression" fieldname="company.cityExpression" fontsize="9" x="10" y="22" fontstyle="plain" width="200" height="12" alignment="left"/>
    <!-- Conditions --> <string-field x="0" y="70" width="530" height="20" fontsize="9" alignment="center" fieldname="factend" fontstyle="plain"/> </pagefooter>
    <!-- Functions -->
    <functions> <function class="org.jfree.report.function.PageOfPagesFunction" name="PAGE_N_OF_M"/>
    <function class="org.jfree.report.function.TriggerPageFooterFunction" name="trigger"/>
    <!-- Surpress warnings --> <property-ref name="dummy-field"/> </functions> </report>

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

    Default

    Ahhh, and here I see the evil doer: TriggerPageFooterFunction

    This function hides the page-footer until the reporting engine tries to print the report-footer. So while your itemband is processed, there is no page-footer we could take into account and therefore no space is reserved for it. Once the report ends and the report-footer appears (which is empty, yes, but still it gets processed) the TriggerPageFooterFunction lets the page-footer appear. But at that point, the itembands have been printed already and the good old engine is not able to undo that printing. Therefore the page-footer begins to overlay the page*

    (This is a simplification. In reallity, the engine sees that something goes wrong, opens a second page, prints the empty report footer, sees that the second page is still empty (page-header and footer do not count as content) and therefore removes that page. Lets say that the old 0.8.7 system had some interesting ways of doing layouting.)

    The TriggerPageFooterFunction is inherently unsafe. One way of getting at least some stability into the report is to declare a fixed-position report-footer instead of the page-footer. Fixed-position bands are printed on a predefined y-position on the page, so you can place the report-footer at the bottom of the page.

    Code:
    <report-footer fixed-position="550">
      ..
    </report-footer>
    This way you dont have to abuse the page-footer to print report-summary information and you dont confuse the poor layouter.

    The weird fun of the page-footer trigger and its side effects is covered by the "report-footer" demos. The fixed-position feature can be seen in the "patient/form demo", where the group footer is positioned at the bottom of the page.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7

    Default

    Aaah, didn't know that... Thanks alot Taqua. I removed the TriggerPageFooterFunction and it works like a charm now.

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.