Adding table border in jasperreports

  • You can add borders with help of GUI designer (iReport, for example) or you can add the box element manually (edit the jrxml file) like in this sample:
<textField>
    <reportElement x="29" y="17" width="100" height="20"/>
    <box>
        <topPen lineWidth="1.0"/>
        <leftPen lineWidth="1.0"/>
        <bottomPen lineWidth="1.0"/>
        <rightPen lineWidth="1.0"/>
    </box>
    <textElement/>
    <textFieldExpression><![CDATA[$F{field}]]></textFieldExpression>
</textField>
  • In iReport you can use “Padding And Borders” context menu.
    iReport context menu

  • In Jaspersoft Studio you can set borders with help of Properties dialog (tab Borders).

enter image description here

Leave a Comment