title: Unable to print borders for empty cells in PDF via JasperReports
body: <p>I am constructing a 'table' by having cells next to each other and they all have borders. But I have a problem where the borders won't show if the cell for workcode text doesn't have a value.</p>
  
  <p>This is my jrxml - (it is a subreport so I have a extra dataset there, and workcodeText is handled this way because I don't know how many workcode text nodes I will have in the xml data.)</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="estimate-subreport" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" scriptletClass="com.cybage.mo.CostCalculation" uuid="2df6e224-aab9-42e3-a97c-aa614b05982c"&gt;
  &lt;property name="ireport.zoom" value="1.5"/&gt;
  &lt;property name="ireport.x" value="0"/&gt;
  &lt;property name="ireport.y" value="0"/&gt;
  &lt;style name="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"&gt;
      &lt;box leftPadding="1" rightPadding="1"/&gt;
  &lt;/style&gt;
  &lt;style name="Normal-Text-Small-with-borders" style="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"&gt;
      &lt;box leftPadding="1" rightPadding="1"&gt;
          &lt;pen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
      &lt;/box&gt;
  &lt;/style&gt;
  &lt;style name="Normal-Text-Small-bold" style="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"&gt;
      &lt;box leftPadding="1" rightPadding="1"/&gt;
  &lt;/style&gt;
  &lt;style name="Normal-Text-Small-bold-with-borders" style="Normal-Text-Small-bold" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"&gt;
      &lt;box leftPadding="1" rightPadding="1"&gt;
          &lt;pen lineColor="#000000"/&gt;
          &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
      &lt;/box&gt;
  &lt;/style&gt;
  &lt;subDataset name="WorkcodeText" uuid="3615899a-9e63-45db-a26e-d4e6d1670f84"&gt;
      &lt;queryString language="xPath"&gt;
          &lt;![CDATA[/MCSResponse/EstimateDisplayResponse/CategoryDetail/WorkcodeDetail/WorkcodeText]]&gt;
      &lt;/queryString&gt;
      &lt;field name="WorkcodeText" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[child::text()]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="last_wct" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[../WorkcodeText[last()]]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;field name="WorkcodeAmount" class="java.lang.String"&gt;
          &lt;fieldDescription&gt;&lt;![CDATA[/MCSResponse/EstimateDisplayResponse/CategoryDetail/WorkcodeDetail/WorkcodeAmount]]&gt;&lt;/fieldDescription&gt;
      &lt;/field&gt;
      &lt;variable name="varWorkcodeText" class="java.lang.String"&gt;
          &lt;variableExpression&gt;&lt;![CDATA[$V{varWorkcodeText}+($F{WorkcodeText} != null? $F{WorkcodeText}:" test ")]]&gt;&lt;/variableExpression&gt;
          &lt;initialValueExpression&gt;&lt;![CDATA[""]]&gt;&lt;/initialValueExpression&gt;
      &lt;/variable&gt;
  &lt;/subDataset&gt;
  &lt;parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"&gt;
      &lt;defaultValueExpression&gt;&lt;![CDATA["D:\\iReport\\Saquib\\Single_Estimate_Report\\Test\\"]]&gt;&lt;/defaultValueExpression&gt;
  &lt;/parameter&gt;
  &lt;queryString language="xPath"&gt;
      &lt;![CDATA[CategoryDetail/WorkcodeDetail]]&gt;
  &lt;/queryString&gt;
  &lt;field name="Workcode" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[Workcode]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;field name="WorkcodeName" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[WorkcodeName]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;field name="ExtraWorkcodeName" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[ExtraWorkcodeName]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;field name="WorkcodeAmount" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[WorkcodeAmount]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;field name="WorkcodeText" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[WorkcodeText]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;field name="ItemDetail" class="java.lang.String"&gt;
      &lt;fieldDescription&gt;&lt;![CDATA[ItemDetail]]&gt;&lt;/fieldDescription&gt;
  &lt;/field&gt;
  &lt;detail&gt;
      &lt;band height="15"&gt;
          &lt;componentElement&gt;
              &lt;reportElement positionType="Float" stretchType="RelativeToTallestObject" x="150" y="0" width="300" height="15" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="6b4ddd03-9978-4f83-a247-3fff22149cb1"/&gt;
              &lt;jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"&gt;
                  &lt;datasetRun subDataset="WorkcodeText" uuid="7aeae23c-e1fe-4470-9ee5-98f84cd82159"&gt;
                      &lt;dataSourceExpression&gt;&lt;![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//WorkcodeText")]]&gt;&lt;/dataSourceExpression&gt;
                  &lt;/datasetRun&gt;
                  &lt;jr:listContents height="15" width="300"&gt;
                      &lt;textField isStretchWithOverflow="true" isBlankWhenNull="true"&gt;
                          &lt;reportElement style="Normal-Text-Small-with-borders" positionType="Float" stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="300" height="15" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#0000FF" uuid="03dd8f13-7604-41be-9155-ae02aa44500e"&gt;
                              &lt;printWhenExpression&gt;&lt;![CDATA[$F{WorkcodeText}.equals($F{last_wct})]]&gt;&lt;/printWhenExpression&gt;
                          &lt;/reportElement&gt;
                          &lt;textElement verticalAlignment="Top"&gt;
                              &lt;font size="9"/&gt;
                          &lt;/textElement&gt;
                          &lt;textFieldExpression&gt;&lt;![CDATA[$V{varWorkcodeText}.replaceAll(  "&lt;nl&gt;", "\n" )]]&gt;&lt;/textFieldExpression&gt;
                      &lt;/textField&gt;
                  &lt;/jr:listContents&gt;
              &lt;/jr:list&gt;
          &lt;/componentElement&gt;
          &lt;textField isStretchWithOverflow="true" isBlankWhenNull="false"&gt;
              &lt;reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="0" y="0" width="20" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3333FF" uuid="8c9080c7-cb77-430c-be2e-b6252f9b8d8e"/&gt;
              &lt;textElement verticalAlignment="Top"&gt;
                  &lt;font size="9"/&gt;
              &lt;/textElement&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[$F{Workcode}]]&gt;&lt;/textFieldExpression&gt;
          &lt;/textField&gt;
          &lt;textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"&gt;
              &lt;reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="450" y="0" width="105" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3300FF" uuid="ebdd4d26-bc29-4546-a9b5-24f2be132aa8"/&gt;
              &lt;textElement textAlignment="Right"&gt;
                  &lt;font size="9"/&gt;
                  &lt;paragraph lineSpacing="Single"/&gt;
              &lt;/textElement&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[($F{WorkcodeAmount}==""||$F{WorkcodeAmount}==null)?0.00:Float.valueOf($F{WorkcodeAmount})/100]]&gt;&lt;/textFieldExpression&gt;
          &lt;/textField&gt;
          &lt;textField isStretchWithOverflow="true" isBlankWhenNull="false"&gt;
              &lt;reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="20" y="0" width="130" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3333FF" uuid="f5fcc495-f401-4498-ac71-7352581cde59"/&gt;
              &lt;textElement verticalAlignment="Top"&gt;
                  &lt;font size="9"/&gt;
                  &lt;paragraph lineSpacing="Single"/&gt;
              &lt;/textElement&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[$F{WorkcodeName}]]&gt;&lt;/textFieldExpression&gt;
          &lt;/textField&gt;
      &lt;/band&gt;
  &lt;/detail&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is the XML I am testing with:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CategoryDetail&gt;
  &lt;CategoryCode&gt;1&lt;/CategoryCode&gt;
  &lt;CategoryName&gt;EXTERNAL CREATIVE&lt;/CategoryName&gt;
  &lt;CategoryTotalName&gt;TOTAL EXTERNAL CREAT&lt;/CategoryTotalName&gt;
  &lt;CategoryType&gt;1&lt;/CategoryType&gt;
  &lt;CategoryStatus&gt;YNNYN&lt;/CategoryStatus&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;1B&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;VISUALS&lt;/WorkcodeName&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;Concept and Development&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;C&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;1C&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;COPY WRITING&lt;/WorkcodeName&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;Visualisation/Finished Art/Lasers&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;C&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;1E&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;PHOTOGRAPHY&lt;/WorkcodeName&gt;
      &lt;WorkcodeAmount&gt;500&lt;/WorkcodeAmount&gt;
      &lt;WorkcodeCommissionAmount&gt;75&lt;/WorkcodeCommissionAmount&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;Setting&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;C&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
      &lt;WorkcodeText&gt;Jaspersoft was originally called Panscopic, and was founded by Al Campa, CEO, and Raj Bhargava, VP of Products in 2001. Panscopic raised $23M from Doll Capital, Discovery Ventures, Morgenthaler Ventures, and Partech. In 2004 Panscopic teamed up with&lt;/WorkcodeText&gt;
      &lt;WorkcodeText&gt; Teodor Danciu,[7] acquired the intellectual property of JasperReports, and changed the name of the company to Jaspersoft. Brian Gentile became CEO in 2007.&amp;lt;nl&amp;gt;&amp;lt;nl&amp;gt;Jaspersoft provides commercial software around the JasperReports product, and negotiat&lt;/WorkcodeText&gt;
      &lt;WorkcodeText&gt;e contracts with software developers that wish to embed the JasperReports engine into a closed source product.&amp;lt;nl&amp;gt;&amp;lt;nl&amp;gt;Jaspersoft's main related product is JasperReports Server, a Java EE web application that provides advanced report server capabiliti&lt;/WorkcodeText&gt;
      &lt;WorkcodeText&gt;es such as report scheduling and permissions. It is available under an open source license for use in conjunction with open source infrastructure such as MySQL and JBoss, or a commercial license for enterprise deployments involving commercial databas&lt;/WorkcodeText&gt;
      &lt;WorkcodeText&gt;es and application servers.&lt;/WorkcodeText&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;1F&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;ILLUSTRATIONS&lt;/WorkcodeName&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;Photography&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;C&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;1G&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;MODEL FEES&lt;/WorkcodeName&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;Models&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;C&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;WorkcodeDetail&gt;
      &lt;WorkcodeCategory&gt;1&lt;/WorkcodeCategory&gt;
      &lt;Workcode&gt;T9&lt;/Workcode&gt;
      &lt;WorkcodeName&gt;T3 Overtime Pr.&lt;/WorkcodeName&gt;
      &lt;WorkcodeCommissionRate&gt;150000&lt;/WorkcodeCommissionRate&gt;
      &lt;WorkcodeFlags&gt;NNNNNNNN&lt;/WorkcodeFlags&gt;
      &lt;ExtraWorkcodeName&gt;T3 Overtime Pr.&lt;/ExtraWorkcodeName&gt;
      &lt;WorkcodeType&gt;T&lt;/WorkcodeType&gt;
      &lt;WorkcodeEstimateCheck&gt;Y&lt;/WorkcodeEstimateCheck&gt;
  &lt;/WorkcodeDetail&gt;
  &lt;/CategoryDetail&gt;
  </code></pre>