Jasper reports 如何为页面的结尾画一条线?
我正在编写Jasper报告。在我的报告中,我希望我的数据采用如下的边框样式 ______ ______ ______ ______ |__H1__|__H2__|__H3__|__H4__| | | | | | | | | | | | | | | | | | | | | |______|______|______|______| ----------Page Footer-------- ______ ______ ______ ______ |__H1_uu124;uuuh2_uu124;uuuuh3_u124;uuuh4_124; | | | | | | | | | | | | | | | | | | | | |______|______|______|______| ----------页脚-------- 我想得到每一页最后一行的底边。我现在得到的是 ______ ______ ______ ______ |__H1__|__H2__|__H3__|__H4__| | | | | | | | | | | | | | | | | | | | | ______ ______ ______ ______ |__H1_uu124;uuuh2_uu124;uuuuh3_u124;uuuh4_124; | | | | | | | | | | | | | | | | | | | | 页脚需要有一个间隙,因此我不能在页脚中使用一行。此外,如果我在页脚中使用了一行,则报告的最后一行将没有底部边框 有没有一种方法可以根据作为页面最后一行的行有条件地启用底部边框Jasper reports 如何为页面的结尾画一条线?,jasper-reports,Jasper Reports,我正在编写Jasper报告。在我的报告中,我希望我的数据采用如下的边框样式 ______ ______ ______ ______ |__H1__|__H2__|__H3__|__H4__| | | | | | | | | | | | | | | | | | | | | |______|______|______|______|
画线,然后
columnFooter
标注并设置isFloatColumnFooter=“true”
isFloatColumnFooter=true
,在该特定列的最后一个细节或组页脚下方渲染列页脚
示例
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4_8" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="28bc671c-47fc-4083-8211-a3f952643349">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="5 empty records"/>
<queryString>
<![CDATA[]]>
</queryString>
<columnHeader>
<band height="1">
<line>
<reportElement x="0" y="0" width="300" height="1" uuid="226f98ce-bb08-4741-a5af-3073ce2aee3a"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="30" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<textField>
<reportElement x="150" y="0" width="150" height="30" uuid="5279e4bc-05ce-46d7-b4cf-ef703d105d92">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box padding="5">
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["Text Field " + $V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="150" height="30" uuid="96e9515f-fab2-483d-926b-6bc799199562"/>
<box padding="5">
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="1" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<line>
<reportElement x="0" y="0" width="300" height="1" uuid="226f98ce-bb08-4741-a5af-3073ce2aee3a"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
</band>
</columnFooter>
</jasperReport>
输出(使用5条记录的空数据源运行)
注意,当创建报告作为发票等时,使用修复
页面上的行(不依赖于数据源)
background
可以使用波段
非常感谢您的详细回复。我尝试了你的建议,它在所有页面上都很有效,除了最后一页,因为列页脚显示在摘要之后。有没有办法不在最后一页显示列页脚?@PrakashAr jasperReport标记上有一个属性,isSummaryNewPage=“true”,您还有isSummaryWithPageHeaderAndFooter=“false”,请尝试这些。