title: How to expand/resize background band of jasper report dynamically?
body: <p>I am using <code>jasper report</code> to download some document in pdf format. I have several subreports and their content may vary according the data coming and hence height of each subreport changes on runtime.</p>
  
  <p>I required to set a border on each subreport after lots of google I found backgroung band can draw the border. Border is shown but its height is not changing according the data coming from database.</p>
  
  <p>Following is my background band:</p>
  
  <pre><code>&lt;background&gt;
      &lt;band height="66" splitType="Stretch"&gt;
          &lt;frame&gt;
              &lt;reportElement uuid="dedc4468-e4b5-4aec-8979-0c6b9a0c0ded" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="515" height="66"/&gt;
              &lt;box&gt;
                  &lt;topPen lineWidth="2.0" lineStyle="Solid"/&gt;
                  &lt;leftPen lineWidth="2.0" lineStyle="Solid"/&gt;
                  &lt;bottomPen lineWidth="2.0" lineStyle="Solid"/&gt;
                  &lt;rightPen lineWidth="2.0" lineStyle="Solid"/&gt;
              &lt;/box&gt;
          &lt;/frame&gt;
      &lt;/band&gt;
  &lt;/background&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/cfgLr.png" alt="enter image description here"></p>
  
  <p>So my problem is how can I expand or resize the height of the background band?</p>
  
  <p><strong>Note:-</strong> I am using <code>dynamic jasper</code> report because the positions of jasper subreport may vary. </p>