0
votes

How to display column boundaries at break due to content?

  1. All content is transferred to the second page, but I would like to stay it on the first page.
  2. On the third page (after the break) for the columns do not display borders

Case 1:

Case 1

Case 2:

Case 2

I've read: How to avoid of missing cell's border when a record is separated between 2 pages? but it didn't worked.

TIBCO Jaspersoft® Studio 6.8.0 - Visual Designer for JasperReports 6.8.0.

<?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="TableReport" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isFloatColumnFooter="true" uuid="c927e671-66f3-40f2-a189-49d30d607fe5">
    <property name="net.sf.jasperreports.export.pdf.tagged" value="true"/>
    <property name="net.sf.jasperreports.export.pdf.tag.language" value="EN-US"/>
    <property name="net.sf.jasperreports.export.pdf.metadata.title" value="Tabular Report"/>
    <property name="net.sf.jasperreports.export.pdf.display.metadata.title" value="true"/>
    <style name="Sans_Normal" isDefault="true" fontName="DejaVu Sans" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
    <style name="Table">
        <box>
            <pen lineWidth="1.0" lineColor="#FF0000"/>
        </box>
    </style>
    <style name="TableHeader" mode="Opaque" backcolor="#808080"/>
    <style name="TableFooter" mode="Opaque" backcolor="#C0C0C0"/>
    <subDataset name="TableData" uuid="c97671fc-0b4b-478a-828d-ced52c9cb393">
        <variable name="Column1" class="java.lang.String">
            <variableExpression><![CDATA["multi\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline textmulti\nline text"]]></variableExpression>
        </variable>
        <variable name="Column2" class="java.lang.String">
            <variableExpression><![CDATA["text two"]]></variableExpression>
        </variable>
        <variable name="Column3" class="java.lang.String">
            <variableExpression><![CDATA["text three"]]></variableExpression>
        </variable>
        <variable name="Column4" class="java.lang.String">
            <variableExpression><![CDATA["text four"]]></variableExpression>
        </variable>
        <variable name="Column5" class="java.lang.String">
            <variableExpression><![CDATA["12345"]]></variableExpression>
        </variable>
    </subDataset>
    <parameter name="TableDataSource" class="net.sf.jasperreports.engine.JRDataSource"/>
    <title>
        <band height="150" splitType="Stretch">
            <staticText>
                <reportElement x="180" y="5" width="375" height="40" uuid="ce2a6b5f-8284-4bd5-82ad-8e8515d2afb6">
                    <property name="net.sf.jasperreports.export.pdf.tag.h1" value="full"/>
                </reportElement>
                <textElement textAlignment="Right">
                    <font size="22"/>
                </textElement>
                <text><![CDATA[Table Report]]></text>
            </staticText>
            <componentElement>
                <reportElement style="Table" x="0" y="50" width="555" height="100" uuid="c475c968-5a05-4331-8147-5fc24a48070b">
                    <property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
                    <property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
                </reportElement>
                <c:table xmlns:c="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    <datasetRun subDataset="TableData" uuid="2e963060-c6d1-4d40-bf9e-08c82c085560">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
                    </datasetRun>
                    <c:column width="100" uuid="ceaf6eb4-f1e9-4aa8-aca6-3e53b67c1615">
                        <c:columnHeader style="TableHeader" height="30" rowSpan="2">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="30" uuid="2866e22e-bec7-41a4-98fd-55ad697b0a2e"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Header 1]]></text>
                            </staticText>
                        </c:columnHeader>
                        <c:columnFooter style="TableFooter" height="15">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="15" uuid="54493ad7-b6d2-4f58-94a5-7428d5cfef7b"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Total 1]]></text>
                            </staticText>
                        </c:columnFooter>
                        <c:detailCell height="15">
                            <box leftPadding="10">
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="90" height="15" isPrintWhenDetailOverflows="true" uuid="3cb2a7df-0412-4b7b-b72a-dd6ccf066815"/>
                                <text><![CDATA[]]></text>
                            </staticText>
                            <textField isStretchWithOverflow="true">
                                <reportElement x="0" y="0" width="90" height="15" uuid="c6a3b183-a488-4535-9187-6c4250a443b6"/>
                                <textFieldExpression><![CDATA[$V{Column1}]]></textFieldExpression>
                            </textField>
                        </c:detailCell>
                    </c:column>
                    <c:column width="100" uuid="d1059c8a-83e2-46b7-bd4a-4920e4661363">
                        <c:columnHeader style="TableHeader" height="30" rowSpan="2">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                                <leftPen lineWidth="0.5"/>
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="30" uuid="10955f42-4b3b-4c06-b277-bc06c8af4529"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Header 2]]></text>
                            </staticText>
                        </c:columnHeader>
                        <c:columnFooter style="TableFooter" height="15">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                                <leftPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="15" uuid="6da45801-60da-413d-baf4-c13338db0d80"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Total 2]]></text>
                            </staticText>
                        </c:columnFooter>
                        <c:detailCell height="15">
                            <box leftPadding="10">
                                <leftPen lineWidth="0.5"/>
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="90" height="15" isPrintWhenDetailOverflows="true" uuid="cdc47144-f1c1-4112-8e4f-9301d4b03ce9"/>
                                <text><![CDATA[]]></text>
                            </staticText>
                            <textField>
                                <reportElement x="0" y="0" width="90" height="15" uuid="ff6cedd6-b2c5-4546-ae1b-6d57423f1f92"/>
                                <textFieldExpression><![CDATA[$V{Column2}]]></textFieldExpression>
                            </textField>
                        </c:detailCell>
                    </c:column>
                    <c:column width="100" uuid="c781c258-fc9e-4a2d-82bd-01e2f40a4658">
                        <c:columnHeader style="TableHeader" height="30" rowSpan="2">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                                <leftPen lineWidth="0.5"/>
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="30" uuid="7540e3b2-5d37-4fe4-91a8-2547940ba5f7"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Header 3]]></text>
                            </staticText>
                        </c:columnHeader>
                        <c:columnFooter style="TableFooter" height="15">
                            <box leftPadding="10">
                                <pen lineColor="#000000"/>
                                <leftPen lineWidth="0.5"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="90" height="15" uuid="64482f3d-8d8b-4eed-b71c-142a596219e4"/>
                                <textElement verticalAlignment="Middle">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Total 3]]></text>
                            </staticText>
                        </c:columnFooter>
                        <c:detailCell height="15">
                            <box leftPadding="10">
                                <leftPen lineWidth="0.5"/>
                                <bottomPen lineWidth="0.5"/>
                            </box>
                            <textField>
                                <reportElement x="0" y="0" width="90" height="15" uuid="329d33c4-e976-4aa2-8022-40e957727eb7"/>
                                <textFieldExpression><![CDATA[$V{Column3}]]></textFieldExpression>
                            </textField>
                        </c:detailCell>
                    </c:column>
                    <c:columnGroup width="255" uuid="3098567e-0813-4e4a-9aad-58bae2a5b2ab">
                        <c:columnHeader style="TableHeader" height="15">
                            <box>
                                <pen lineWidth="0.5" lineColor="#000000"/>
                            </box>
                            <staticText>
                                <reportElement x="0" y="0" width="255" height="15" uuid="9b8eb5e6-3655-473a-b2d1-bce80f90ce8f"/>
                                <textElement textAlignment="Center">
                                    <font size="12" isBold="true"/>
                                </textElement>
                                <text><![CDATA[Header 4]]></text>
                            </staticText>
                        </c:columnHeader>
                        <c:column width="155" uuid="e3df35d7-6ce7-4941-a1f0-860fb62afd53">
                            <c:columnHeader style="TableHeader" height="15">
                                <box leftPadding="10">
                                    <pen lineColor="#000000"/>
                                    <topPen lineWidth="0.5"/>
                                    <leftPen lineWidth="0.5"/>
                                    <bottomPen lineWidth="0.5"/>
                                </box>
                                <staticText>
                                    <reportElement x="0" y="0" width="145" height="15" uuid="d0904ae1-535f-4d94-bfe4-881544398d85"/>
                                    <textElement>
                                        <font isBold="true"/>
                                    </textElement>
                                    <text><![CDATA[Header 4.1]]></text>
                                </staticText>
                            </c:columnHeader>
                            <c:columnFooter style="TableFooter" height="15">
                                <box leftPadding="10">
                                    <pen lineColor="#000000"/>
                                    <leftPen lineWidth="0.5"/>
                                </box>
                                <staticText>
                                    <reportElement x="0" y="0" width="145" height="15" uuid="1239625e-5331-40b5-b7c6-80e58fe4859c"/>
                                    <textElement>
                                        <font size="12" isBold="true"/>
                                    </textElement>
                                    <text><![CDATA[Total 4.1]]></text>
                                </staticText>
                            </c:columnFooter>
                            <c:detailCell height="15">
                                <box leftPadding="10">
                                    <leftPen lineWidth="0.5"/>
                                    <bottomPen lineWidth="0.5"/>
                                </box>
                                <textField>
                                    <reportElement x="0" y="0" width="145" height="15" uuid="a777c29e-db77-4564-a35a-64b990469e57"/>
                                    <textFieldExpression><![CDATA[$V{Column4}]]></textFieldExpression>
                                </textField>
                            </c:detailCell>
                        </c:column>
                        <c:column width="100" uuid="898732fe-58d7-4115-8bf7-fbe53da49eb1">
                            <c:columnHeader style="TableHeader" height="15">
                                <box rightPadding="10">
                                    <pen lineColor="#000000"/>
                                    <topPen lineWidth="0.5"/>
                                    <leftPen lineWidth="0.5"/>
                                    <bottomPen lineWidth="0.5"/>
                                </box>
                                <staticText>
                                    <reportElement x="0" y="0" width="90" height="15" uuid="e5247217-993a-44c8-8fc0-d8de72cf93b2"/>
                                    <textElement textAlignment="Right">
                                        <font isBold="true"/>
                                    </textElement>
                                    <text><![CDATA[Header 4.2]]></text>
                                </staticText>
                            </c:columnHeader>
                            <c:columnFooter style="TableFooter" height="15">
                                <box rightPadding="10">
                                    <pen lineColor="#000000"/>
                                    <leftPen lineWidth="0.5"/>
                                </box>
                                <staticText>
                                    <reportElement x="0" y="0" width="90" height="15" uuid="a1ab288e-ae4b-4f12-83a5-e30486bb30d5"/>
                                    <textElement textAlignment="Right">
                                        <font size="12" isBold="true"/>
                                    </textElement>
                                    <text><![CDATA[Total 4.2]]></text>
                                </staticText>
                            </c:columnFooter>
                            <c:detailCell height="15">
                                <box>
                                    <leftPen lineWidth="0.5"/>
                                    <bottomPen lineWidth="0.5"/>
                                </box>
                                <textField>
                                    <reportElement x="0" y="0" width="100" height="15" uuid="db6d906d-9dd3-463c-a8d3-5aae4b6a944f"/>
                                    <textElement textAlignment="Right"/>
                                    <textFieldExpression><![CDATA[$V{Column5}]]></textFieldExpression>
                                </textField>
                            </c:detailCell>
                        </c:column>
                    </c:columnGroup>
                </c:table>
            </componentElement>
        </band>
    </title>
</jasperReport>
1

1 Answers

1
votes

The link does not work for me to. I also found no solution at that time, so I tried something different. If the following settings work, you will don't need any vertical Borders:

Table:

  • Layout = Vertikal
  • Position type = Float
  • Stretch Type = Relative to band Height
  • Print in First Whole Band = true

Text Felder in Table:

  • Position Type = Float
  • Steche Type = Relative to Band Height
  • Transparent = true
  • Print in First Whole Band = true
  • Detail Overflow = true
  • Evaluation time = Now
  • Stretch with Overflow = tue

If this is not what you wanted, try to set Parameters.