title: How to stretch textfield in a JasperReport as per dynamic content?
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="tree-template" pageWidth="595" pageHeight="842" columnWidth="481" leftMargin="57" rightMargin="57" topMargin="72" bottomMargin="72"&gt;
      &lt;style name="Title" forecolor="#000000" fontName="Times New Roman" fontSize="50" isBold="false" pdfFontName="Times-Bold"/&gt;
      &lt;style name="SubTitle" forecolor="#666666" fontName="Times New Roman" fontSize="18" isBold="false" pdfFontName="Times-Roman"/&gt;
      &lt;style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true" pdfFontName="Times-Roman"/&gt;
      &lt;style name="Detail" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"/&gt;
      &lt;style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"&gt;
          &lt;conditionalStyle&gt;
              &lt;conditionExpression&gt;&lt;![CDATA[$V{REPORT_COUNT}%2 == 0]]&gt;&lt;/conditionExpression&gt;
              &lt;style mode="Opaque" backcolor="#F0EFEF"/&gt;
          &lt;/conditionalStyle&gt;
      &lt;/style&gt;
      &lt;parameter name="JasperCustomSubReportLocation" class="net.sf.jasperreports.engine.JasperReport"/&gt;
      &lt;parameter name="JasperCustomSubReportDatasource" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/&gt;
      &lt;field name="name" class="java.lang.String"/&gt;
      &lt;field name="notes" class="java.lang.String"/&gt;
      &lt;field name="state" class="java.lang.String"/&gt;
      &lt;field name="project" class="com.pearson.ltg.qmo.dashboard.domain.QDashProject"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[project]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="theme" class="java.lang.String"/&gt;
      &lt;field name="goals" class="java.lang.String"/&gt;
      &lt;field name="statusDetails" class="java.lang.String"/&gt;
      &lt;field name="mitigation" class="java.lang.String"/&gt;
      &lt;field name="status" class="java.lang.String"/&gt;
      &lt;field name="releaseDate" class="java.util.Calendar"/&gt;
      &lt;group name="Group1"&gt;
          &lt;groupExpression&gt;&lt;![CDATA[(int)($V{REPORT_COUNT}/15)]]&gt;&lt;/groupExpression&gt;
      &lt;/group&gt;
      &lt;group name="Group2"&gt;
          &lt;groupExpression&gt;&lt;![CDATA[(int)($V{REPORT_COUNT}/5)]]&gt;&lt;/groupExpression&gt;
          &lt;groupHeader&gt;
              &lt;band height="10"/&gt;
          &lt;/groupHeader&gt;
      &lt;/group&gt;
      &lt;title&gt;
          &lt;band height="58" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement style="Title" x="4" y="0" width="477" height="56"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="48" isBold="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Release Details]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/title&gt;
      &lt;detail&gt;
          &lt;band height="189" splitType="Stretch"&gt;
              &lt;frame&gt;
                  &lt;reportElement mode="Opaque" x="0" y="7" width="481" height="13" forecolor="#D0B48E" backcolor="#9DB1B8"/&gt;
              &lt;/frame&gt;
              &lt;textField&gt;
                  &lt;reportElement x="279" y="7" width="202" height="13"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{name}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="79" y="7" width="100" height="13"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{project}.getName()]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="2" y="7" width="79" height="13"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Platform : ]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="179" y="7" width="100" height="13"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="10" isBold="true" isItalic="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Release Name :]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="0" y="20" width="47" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Status : ]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement x="79" y="20" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{status}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="0" y="40" width="79" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Release Date: ]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="0" y="60" width="181" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Release Goals]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
  ##want this field to auto stretch as per content##
              &lt;textField isStretchWithOverflow="true" isBlankWhenNull="true"&gt;
                  &lt;reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="80" width="463" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{goals}==null ? "Not Defined":$F{goals}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
  ##want this field to auto stretch as per content##
              &lt;staticText&gt;
                  &lt;reportElement stretchType="RelativeToTallestObject" x="0" y="100" width="98" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Status Details]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField isStretchWithOverflow="true"&gt;
                  &lt;reportElement stretchType="RelativeToTallestObject" x="2" y="120" width="463" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{statusDetails}==null ? "Not Defined":$F{statusDetails}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement stretchType="RelativeToTallestObject" x="0" y="140" width="98" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Risk Mitigation]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement stretchType="RelativeToTallestObject" x="18" y="160" width="463" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{mitigation}==null?"Not Defined":$F{mitigation}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement stretchType="RelativeToTallestObject" x="79" y="40" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[new SimpleDateFormat("MMM dd,yyyy").format($F{releaseDate}.getTime())]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;line&gt;
                  &lt;reportElement x="0" y="180" width="481" height="1"/&gt;
              &lt;/line&gt;
          &lt;/band&gt;
      &lt;/detail&gt;
      &lt;columnFooter&gt;
          &lt;band height="12" splitType="Stretch"/&gt;
      &lt;/columnFooter&gt;
      &lt;pageFooter&gt;
          &lt;band height="13" splitType="Stretch"&gt;
              &lt;frame&gt;
                  &lt;reportElement mode="Opaque" x="0" y="0" width="477" height="13" forecolor="#D0B48E" backcolor="#9DB1B8"/&gt;
                  &lt;textField pattern="EEEEE dd MMMMM yyyy"&gt;
                      &lt;reportElement style="Column header" x="2" y="0" width="197" height="13" forecolor="#FFFFFF"/&gt;
                      &lt;textElement verticalAlignment="Middle"&gt;
                          &lt;font size="10" isBold="false"/&gt;
                      &lt;/textElement&gt;
                      &lt;textFieldExpression class="java.util.Date"&gt;&lt;![CDATA[new java.util.Date()]]&gt;&lt;/textFieldExpression&gt;
                  &lt;/textField&gt;
                  &lt;textField evaluationTime="Report"&gt;
                      &lt;reportElement style="Column header" x="450" y="0" width="27" height="13" forecolor="#FFFFFF"/&gt;
                      &lt;textElement verticalAlignment="Middle"&gt;
                          &lt;font size="10" isBold="false"/&gt;
                      &lt;/textElement&gt;
                      &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[" " + $V{PAGE_NUMBER}]]&gt;&lt;/textFieldExpression&gt;
                  &lt;/textField&gt;
                  &lt;textField&gt;
                      &lt;reportElement style="Column header" x="370" y="0" width="80" height="13" forecolor="#FFFFFF"/&gt;
                      &lt;textElement textAlignment="Right" verticalAlignment="Middle"&gt;
                          &lt;font size="10" isBold="false"/&gt;
                      &lt;/textElement&gt;
                      &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]&gt;&lt;/textFieldExpression&gt;
                  &lt;/textField&gt;
              &lt;/frame&gt;
          &lt;/band&gt;
      &lt;/pageFooter&gt;
  &lt;/jasperReport&gt;
  </code></pre>