将当前页码与最后一页编号进行比较 [英] Compare current page number with last page number

查看:165
本文介绍了将当前页码与最后一页编号进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查看当前打印的页面是否实际上是最后打印的页面?

How do you check to see if the current printed page is actually the last printed page?

我尝试过以下操作:

$V{currentPage}.intValue() == $V{totalNumberOfPages} ?
  Boolean.TRUE : Boolean.FALSE


推荐答案

等了很久..但没有来自Stackoverflow的回复...
无论如何我找到了我的解决方案..

waited for a long time .. but no reply from Stackoverflow... Anyway i found my solution..

首先在你的摘要乐队中放这一行

First in your summary band put this line

<printWhenExpression><![CDATA[new Boolean($P{REPORT_PARAMETERS_MAP}.put("LastPageNumber",$V{PAGE_NUMBER}).equals("dummyPrintWhen"))]]></printWhenExpression>

请记住,以上行必须仅在报告的摘要范围内。

Remember this above line must be only in the summary band of the report.

之后,您可以在报告中的任何时间点比较此参数,以查找最后一页的编号。

After that you can compare this parameter at any point of time in your report to find last page number .

例如

<printWhenExpression><![CDATA[new Boolean(!$V{PAGE_NUMBER}.equals($P{REPORT_PARAMETERS_MAP}.get("LastPageNumber")))]]></printWhenExpression>

这篇关于将当前页码与最后一页编号进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆