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

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:32:39

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.

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>

Try using a PrintWhenExpression of

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

You can try to use "Last Page Footer" band

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!