加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

jasper-reports – 如何在“单一文本字段”中显示jasper报告5.5.

发布时间:2020-12-14 05:02:16 所属栏目:百科 来源:网络整理
导读:我有一种情况,我需要这种格式的页脚页码: --------------------------------------------------------------------------------page 1 of 4212 printed date: 页面号应该左对齐左边距.我用这个表达 "Page "+$V{PAGE_NUMBER}+ " of "+ $V{PAGE_NUMBER} 但它
我有一种情况,我需要这种格式的页脚页码:

--------------------------------------------------------------------------------
page 1 of 4212                                              printed date:

页面号应该左对齐左边距.我用这个表达

"Page "+$V{PAGE_NUMBER}+ " of "+ $V{PAGE_NUMBER}

但它总是给出输出

"Page 1 of 1"

如何在左对齐的单个文本字段中实现它???
请帮我解决这个问题.

解决方法

见: http://community.jaspersoft.com/questions/893771/printing-page-x-y-single-textfield-logic-jasper-ultimate-guide-section-1922

使用此定义创建变量(请注意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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读