Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid of missing cell's border when a record is separated between 2 pages?

When the last entry in a page is too long, It will show in next page, when it show all the table line is missing.

This is the result:

enter image description here

How do I move the last record (no.26) to the next page, or how I can show the line?

like image 278
Hariawan Avatar asked Dec 28 '22 07:12

Hariawan


1 Answers

You can put the staticText element without text behind the textField element. You should set stretchType property with RelativeToTallestObject value and isPrintWhenDetailOverflows property with true value.

The sample:

<detail>
    <band height="20" splitType="Stretch">
        <staticText>
            <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="100" height="20" isPrintWhenDetailOverflows="true"/>
            <box>
                <leftPen lineWidth="1.0"/>
                <bottomPen lineWidth="1.0"/>
                <rightPen lineWidth="1.0"/>
            </box>
            <textElement/>
            <text><![CDATA[]]></text>
        </staticText>
        <textField>
            <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="100" height="20"/>
            <box>
                <leftPen lineWidth="1.0"/>
                <bottomPen lineWidth="1.0"/>
                <rightPen lineWidth="1.0"/>
            </box>
            <textElement/>
            <textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
        </textField>

As result you will get the vertical border at the second page.

The text from resulting PDF file with vertical border after using the staticText

The result before adding the second staticText was (the vertical border at the second page is absent):

The text from resulting PDF file without vertical border before using the staticText

like image 145
Alex K Avatar answered Jan 13 '23 14:01

Alex K