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标签里面。