title: Removing blank entries from a Jasper report
body: <p>I have created a report within the jrxml. I have specified to only print the details of each value if one of my fields is populated using the tag <code>&lt;printWhenExpression&gt;</code> with a value like so:</p>
  
  <pre><code>&lt;textField&gt;
              &lt;reportElement x="670" y="4" width="105" height="20" isRemoveLineWhenBlank="true"&gt;
                  &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
              &lt;/reportElement&gt;
              &lt;textElement&gt;
                  &lt;font fontName="Arial" size="10"/&gt;
              &lt;/textElement&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[$F{value2}]]&gt;&lt;/textFieldExpression&gt;
  </code></pre>
  
  <p>This works in filtering only relevant data, however it leaves me with a lot of blank rows within the report. I have enabled the condition <code>isRemoveLineWhenBlank="true"</code> to remove these blank rows from being displayed on my report. This has taken my report from 12 pages to 5, however, I still observe a large number of empty rows within the report.</p>
  
  <p>Here is a ScreenShot of my reports design in ireport.</p>
  
  <p><img src="https://i.stack.imgur.com/JW7HM.jpg" alt="enter image description here"></p>
  
  <p>And here is a ScreenShot of the report run (I've blanked out my company's name from the classes)</p>
  
  <p><img src="https://i.stack.imgur.com/dqnuG.jpg" alt="enter image description here"></p>
  
  <p>The full report JRXML:</p>
  
  <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="RIOBridgeReport" pageWidth="1530" pageHeight="842" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="10" rightMargin="5" topMargin="10" bottomMargin="10"&gt;
      &lt;property name="ireport.zoom" value="2.0"/&gt;
      &lt;property name="ireport.x" value="0"/&gt;
      &lt;property name="ireport.y" value="0"/&gt;
      &lt;property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/&gt;
      &lt;parameter name="title" class="java.lang.String"/&gt;
      &lt;parameter name="oneliner" class="java.lang.String"/&gt;
      &lt;field name="name" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[id[starts-with(.,'USCS')]]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="class" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[class]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="value" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[constructor-arg/value]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="value1" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[constructor-arg[1]/value]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="value2" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[constructor-arg[2]/value]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;variable name="runDate" class="java.lang.String"&gt;
          &lt;initialValueExpression&gt;&lt;![CDATA[new java.text.SimpleDateFormat("dd-MMM-yyyy HH:mm:ss Z").format(new java.util.Date())]]&gt;&lt;/initialValueExpression&gt;
      &lt;/variable&gt;
      &lt;background&gt;
          &lt;band splitType="Stretch"/&gt;
      &lt;/background&gt;
      &lt;title&gt;
          &lt;band height="53" splitType="Stretch"&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="12" y="12" width="496" height="20"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font fontName="Arial" size="14" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$P{title} + " - " + $V{runDate}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;image&gt;
                  &lt;reportElement x="616" y="0" width="84" height="53"/&gt;
                  &lt;imageExpression&gt;&lt;![CDATA["citi_corp_logo.gif"]]&gt;&lt;/imageExpression&gt;
              &lt;/image&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="12" y="32" width="496" height="20"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font fontName="Arial" size="10" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$P{oneliner}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/title&gt;
      &lt;columnHeader&gt;
          &lt;band height="23" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="12" y="2" width="85" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10" isBold="true" isUnderline="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Bean Name]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="228" y="2" width="85" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10" isBold="true" isUnderline="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Class]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="428" y="2" width="105" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10" isBold="true" isUnderline="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Value]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="543" y="2" width="105" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10" isBold="true" isUnderline="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Value1]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="670" y="2" width="105" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10" isBold="true" isUnderline="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Value2]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/columnHeader&gt;
      &lt;detail&gt;
          &lt;band height="24"&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="12" y="2" width="216" height="20" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{name}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="228" y="2" width="185" height="20"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{class}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="428" y="2" width="105" height="20"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{value}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="543" y="4" width="105" height="20"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{value1}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="670" y="4" width="105" height="20"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{name}!= null]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Arial" size="10"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{value2}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/detail&gt;
      &lt;noData&gt;
          &lt;band height="20"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="146" y="0" width="200" height="20"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font fontName="Arial" size="14" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[No data found]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/noData&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>As you can see still a large amount of whitespace left within the report. Is there a way to completely remove them or push the blank rows to the end of the report.</p>