我有一种情况,我需要这种格式的页脚页码: --------------------------------------------------------------------------------page 1 of 4212 printed date: 页面号应该左对齐左边距.我用这个表达 "Page "+$V{PAGE_NUM
-------------------------------------------------------------------------------- page 1 of 4212 printed date:
页面号应该左对齐左边距.我用这个表达
"Page "+$V{PAGE_NUMBER}+ " of "+ $V{PAGE_NUMBER}
但它总是给出输出
"Page 1 of 1"
如何在左对齐的单个文本字段中实现它???
请帮我解决这个问题.
使用此定义创建变量(请注意resetType)
<variable name="currentPageNumber" class="java.lang.Integer" resetType="Page"> <variableExpression><![CDATA[$V{PAGE_NUMBER}]]></variableExpression> </variable>
页码字段(注意评估时间):
<textField evaluationTime="Auto"> <reportElement uuid="847e339f-a1a6-492d-868b-b233f71785b4" x="166" y="22" width="100" height="20"/> <textElement/> <textFieldExpression><![CDATA[$V{currentPageNumber} + " of " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField>