Вы можете поместить элемент staticText
без текста позади элемента textField
.Вы должны установить stretchType
свойство со значением RelativeToTallestObject и isPrintWhenDetailOverflows
свойством с true значение.
Пример:
<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>
В результате вы получите вертикальную границу на второй странице.
![The text from resulting PDF file with vertical border after using the staticText](https://i.stack.imgur.com/AFzGF.png)
Результат до добавления второго staticText
был ( вертикальная граница на второй странице отсутствует ):
![The text from resulting PDF file without vertical border before using the staticText](https://i.stack.imgur.com/ZNYTz.png)