Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print the grand total only in the last page of a very long report?

How can I make the total paramater appear only on the last page of a report with lots of concepts.

The report repeats istelf until the list of concepts is displayed in two or more pages. The total appears in all of them because the parameter (received as $PTotal) is on the footer of the page.

I need this to be displayed only in the footer of the last page. It doesnt matter if I leave that space as blank, I just need the parameter to be displayed only at the last page.

This is not a report composed of varios pages, it generates multiple pages until the list fits. Just to clarify.

enter image description here

How can I fix that parameter tag with a printWhenExpression tag?

like image 618
enon Avatar asked Dec 22 '22 09:12

enon


1 Answers

If you just use the summary-band for this purpose?

  .......
  <summary>
    <band height="146" splitType="Stretch">
      <reportElement .../>
       <textElement ...>
         <font .../>
       </textElement>
       <textFieldExpression class="java.lang.String"><![CDATA[$P{total}]]>           </textFieldExpression>
    </band>
  </summary>
</jasperReport>
like image 126
lkdg Avatar answered May 01 '23 11:05

lkdg