jasper report实现将特定的内容放到最后一页

pageFooter和lastPageFooter

页脚使用标签pageFooter,每一页都会在页脚显示内容,比如显示页码;
页脚使用标签lastPageFooter,只会在最后一页显示内容,比如显示商标盖章图标之类的;

<pageFooter>
		<band height="20" splitType="Stretch">
			<textField evaluationTime="Auto">
				<reportElement x="435" y="0" width="100" height="20" uuid="1111"/>
				<box rightPadding="10">
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Right">
					<font pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{REPORT_PAGE} +" / " +$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<lastPageFooter>
		<band height="40" splitType="Stretch">
			<textField evaluationTime="Auto">
				<reportElement x="435" y="0" width="100" height="20" uuid="112"/>
				<box rightPadding="10">
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Right">
					<font pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression>商标图片</textFieldExpression>
			</textField>
			<textField evaluationTime="Auto">
				<reportElement x="435" y="20" width="100" height="20" uuid="113"/>
				<box rightPadding="10">
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Right">
					<font pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{REPORT_PAGE} +" / " +$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</lastPageFooter>

验证发现,pageFooter显示页码,如果lastPageFooter只添加商标图片的话,最后一页是没有页码的,所以也需要将页码的表达式添加到lastPageFooter标签里面。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值