想要显示“待续约”。对于报告和上次报告中的所有页面“报告结束”必须使用iReport显示 [英] Would like to display "To be contined" for all pages in report and for last report "End of report" has to be displayed using iReport

查看:131
本文介绍了想要显示“待续约”。对于报告和上次报告中的所有页面“报告结束”必须使用iReport显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个iReport,它应该显示报告中的所有记录。如果报告有2页例如,则第一页应显示待续第二页应显示报告结束,无论您使用的页数是多少。

I have designed an iReport where it should display all the records in the report. If a report has 2 pages for example then first page should display "To be continued" second page should display "End of the report" irrespective of number of pages you are working with.

我在报告的页脚上放置了一个标签,并将属性打印时表达式更改为

I have placed a label at the footer of the report and changed the properties "print when expression" as

$V{PAGE_NUMBER}.equals($V{PAGE_COUNT}.toString()) ? "End of Report" : "Continue"

并在执行报告时显示错误

and displays error while executing the report

Error filling print... java.lang.String cannot be cast to java.lang.Boolean 
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean 


推荐答案

您应填写的属性是文本字段expresion 并更改者:

The property that you should fill is Text field expresion and change by:

$V{PAGE_NUMBER}.equals($V{PAGE_COUNT}) ? "End of Report" : "Continue"

因为您正在比较整数。

xml中的文本字段应为:

Your text field in the xml should be:

<textField>
    <reportElement x="xx" y="xx" width="xx" height="xx" uuid="xxxx"/>
    <textElement textAlignment="xxx" verticalAlignment="xxx">
        <font fontName="xx"/>
    </textElement>
    <textFieldExpression><![CDATA[$V{PAGE_NUMBER}.equals($V{PAGE_COUNT}) ? "End of Report" : "Continue"]]></textFieldExpression>
</textField>

这篇关于想要显示“待续约”。对于报告和上次报告中的所有页面“报告结束”必须使用iReport显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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