title: Jasper report : TextField Stretch inside Frame
body: <p>Hi I am using jasperreports verion + 5.0.1</p>
  
  <p>I am trying to apply stretch for one of the text field. 
  I kept this frame in a detail band. Underneath this frame I have another frame. </p>
  
  <p>My requirement here is to stretch the text field mailingAddress and agentAddress. These details will be exported into a PDF.
  Which in-turn should stretch the frame along with the frames below need to be pushed accordingly in vertical position. </p>
  
  <pre><code>&lt;frame&gt;
     &lt;reportElement positionType="Float" x="0" y="66" width="802" height="14" isPrintWhenDetailOverflows="true" forecolor="#959595" uuid="063598fc-a760-48d4-86e1-c85da3ab415d"&gt;
        &lt;property name="com.jaspersoft.studio.unit.height" value="pixel" /&gt;
        &lt;property name="com.jaspersoft.studio.unit.y" value="px" /&gt;
        &lt;property name="com.jaspersoft.studio.layout" /&gt;
     &lt;/reportElement&gt;
     &lt;box&gt;
        &lt;pen lineWidth="0.25" lineColor="#959595" /&gt;
        &lt;topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000" /&gt;
        &lt;leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" /&gt;
        &lt;bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" /&gt;
        &lt;rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#959595" /&gt;
     &lt;/box&gt;
     &lt;staticText&gt;
        &lt;reportElement style="HeaderElement8x" x="4" y="1" width="70" height="13" isPrintWhenDetailOverflows="true" uuid="8908bd70-9665-4f4c-a501-e07ef7c96cce"&gt;
           &lt;property name="com.jaspersoft.studio.unit.height" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.width" value="px" /&gt;
        &lt;/reportElement&gt;
        &lt;textElement verticalAlignment="Middle"&gt;
           &lt;font size="8" /&gt;
        &lt;/textElement&gt;
        &lt;text&gt;&lt;![CDATA[Mailing Address:]]&gt;&lt;/text&gt;
     &lt;/staticText&gt;
     &lt;textField textAdjust="StretchHeight"&gt;
        &lt;reportElement style="HeaderElementBold7x" positionType="Float" stretchType="RelativeToTallestObject" x="80" y="1" width="200" height="13" isPrintWhenDetailOverflows="true" uuid="e29aefcf-9df6-4dd8-a261-e5a9a7cf1659"&gt;
           &lt;property name="com.jaspersoft.studio.unit.width" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.height" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.x" value="px" /&gt;
        &lt;/reportElement&gt;
        &lt;textElement&gt;
           &lt;font size="7" isBold="true" /&gt;
        &lt;/textElement&gt;
        &lt;textFieldExpression&gt;&lt;![CDATA[$F{mailingAddress}]]&gt;&lt;/textFieldExpression&gt;
     &lt;/textField&gt;
     &lt;staticText&gt;
        &lt;reportElement style="HeaderElement8x" x="362" y="1" width="85" height="13" isPrintWhenDetailOverflows="true" uuid="74a57ccd-1001-46db-ac19-daab648cba60"&gt;
           &lt;property name="com.jaspersoft.studio.unit.height" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.width" value="px" /&gt;
        &lt;/reportElement&gt;
        &lt;textElement verticalAlignment="Middle"&gt;
           &lt;font size="8" /&gt;
        &lt;/textElement&gt;
        &lt;text&gt;&lt;![CDATA[Agent Address:]]&gt;&lt;/text&gt;
     &lt;/staticText&gt;
     &lt;textField&gt;
        &lt;reportElement style="HeaderElementBold7x" positionType="Float" stretchType="RelativeToTallestObject" x="448" y="1" width="200" height="13" isPrintWhenDetailOverflows="true" uuid="cc500f79-88a8-4357-845c-090fab89a0d2"&gt;
           &lt;property name="com.jaspersoft.studio.unit.height" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.width" value="px" /&gt;
           &lt;property name="com.jaspersoft.studio.unit.x" value="px" /&gt;
        &lt;/reportElement&gt;
        &lt;textElement&gt;
           &lt;font size="7" isBold="true" /&gt;
        &lt;/textElement&gt;
        &lt;textFieldExpression&gt;&lt;![CDATA[$F{agentAddress}]]&gt;&lt;/textFieldExpression&gt;
     &lt;/textField&gt;
  &lt;/frame&gt;
  </code></pre>
  
  <p>I tried following but it doesn't worked for me. Help me out with your suggestions please.</p>
  
  <ul>
  <li><a href="https://community.jaspersoft.com/questions/911866/stretch-text-field-data-overflow" rel="nofollow noreferrer">https://community.jaspersoft.com/questions/911866/stretch-text-field-data-overflow</a></li>
  <li><a href="https://stackoverflow.com/questions/28986738/how-to-expand-frames-dynamically-in-jasperreports">How to expand frames dynamically in JasperReports?</a></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/DJmJ5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DJmJ5.png" alt="enter image description here"></a></p>