开发者

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

开发者 https://www.devze.com 2023-03-29 16:05 出处:网络
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 ap

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.

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

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


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>


Copy your footer band and rename it to a lastPageFooter band. Keep the original footer intact, but delete the textField for $P{total} from it. The lastPageFooter band, including your total, will only be printed on the last page of the report.


Try using a PrintWhenExpression of

$V{PAGE_NUMBER} == $V{PAGE_COUNT}


You can try to use "Last Page Footer" band

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号