Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can put the <code>staticText</code> element without text behind the <code>textField</code> element. You should set <strong><em><code>stretchType</code></em></strong> property with <strong>RelativeToTallestObject</strong> value and <strong><em><code>isPrintWhenDetailOverflows</code></em></strong> property with <strong>true</strong> value.</p> <p>The sample:</p> <pre class="lang-xml prettyprint-override"><code>&lt;detail&gt; &lt;band height="20" splitType="Stretch"&gt; &lt;staticText&gt; &lt;reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="100" height="20" isPrintWhenDetailOverflows="true"/&gt; &lt;box&gt; &lt;leftPen lineWidth="1.0"/&gt; &lt;bottomPen lineWidth="1.0"/&gt; &lt;rightPen lineWidth="1.0"/&gt; &lt;/box&gt; &lt;textElement/&gt; &lt;text&gt;&lt;![CDATA[]]&gt;&lt;/text&gt; &lt;/staticText&gt; &lt;textField&gt; &lt;reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="100" height="20"/&gt; &lt;box&gt; &lt;leftPen lineWidth="1.0"/&gt; &lt;bottomPen lineWidth="1.0"/&gt; &lt;rightPen lineWidth="1.0"/&gt; &lt;/box&gt; &lt;textElement/&gt; &lt;textFieldExpression&gt;&lt;![CDATA[$F{id}]]&gt;&lt;/textFieldExpression&gt; &lt;/textField&gt; </code></pre> <p>As result you will get the vertical border at the second page.</p> <p><img src="https://i.stack.imgur.com/AFzGF.png" alt="The text from resulting PDF file with vertical border after using the staticText"></p> <p>The result <strong>before</strong> adding the second <code>staticText</code> was (<em>the vertical border at the second page is absent</em>):</p> <p><img src="https://i.stack.imgur.com/ZNYTz.png" alt="The text from resulting PDF file without vertical border before using the staticText"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload