title: How do I hide a textfield based on the value of several parameters?
body: <p>I am trying to hide a textfield I have placed in the page header band. The field value is determined by several parameters passed into the report when it is ran. Essentially I want the field to be blank or hidden when the parameter values are null (or some of them are null).</p>
  
  <p>When I execute my code i get <code>incompatable operand int and integer</code>. I have attached the report below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"  ?&gt;
  &lt;!-- Created with iReport - A designer for JasperReports --&gt;
  &lt;!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"&gt;
  &lt;jasperReport
           name="Date_Register"
           columnCount="1"
           printOrder="Vertical"
           orientation="Landscape"
           pageWidth="842"
           pageHeight="595"
           columnWidth="802"
           columnSpacing="0"
           leftMargin="20"
           rightMargin="20"
           topMargin="20"
           bottomMargin="20"
           whenNoDataType="AllSectionsNoDetail"
           isTitleNewPage="false"
           isSummaryNewPage="false"&gt;
      &lt;property name="ireport.zoom" value="1.0" /&gt;
      &lt;property name="ireport.x" value="95" /&gt;
      &lt;property name="ireport.y" value="3" /&gt;
      &lt;property name="ireport.scriptlethandling" value="0" /&gt;
      &lt;property name="ireport.encoding" value="UTF-8" /&gt;
      &lt;import value="java.util.*" /&gt;
      &lt;import value="net.sf.jasperreports.engine.*" /&gt;
      &lt;import value="net.sf.jasperreports.engine.data.*" /&gt;
      &lt;import value="com.google.common.base.*" /&gt;
  
      &lt;parameter name="date_start" isForPrompting="true" class="java.sql.Timestamp"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new java.sql.Timestamp(0)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="date_end" isForPrompting="true" class="java.sql.Timestamp"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new java.sql.Timestamp(System.currentTimeMillis())]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="lookup_month" isForPrompting="true" class="java.lang.Integer"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new Integer(-1)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="lookup_year" isForPrompting="true" class="java.lang.Integer"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new Integer(-1)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="lookup_quarter" isForPrompting="true" class="java.lang.Integer"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new Integer(-1)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="lookup_weeks" isForPrompting="true" class="java.lang.Integer"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new Integer(-1)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="woman_status" isForPrompting="true" class="java.lang.String"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA["N"]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="industry_group" isForPrompting="true" class="java.lang.Integer"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA[new Integer(-1)]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="equity_structure" isForPrompting="true" class="java.lang.String"&gt;
          &lt;defaultValueExpression &gt;&lt;![CDATA["BUMIPUTERA"]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;queryString&gt;&lt;![CDATA[select distinct convert(varchar(10),a.entered,103) as daterange,
  a.org_id,
  a.name,
  a.business_name_two,
  a.organization_type,
  c.description as companygroup,lead,
  a.industry_temp_code,
  b.description,
  a.equity_structure,
  case when a.sic_description = 1 then 'BUMIPUTERA'
       when a.sic_description = 2 then 'NON BUMIPUTERA' end race,
  convert(varchar(10),a.entered,103) as
  dateregister
  from organization a
  left join lookup_industry b on a.industry_temp_code = b.code
  left join lookup_company_group c on c.code = a.company_group
  left join ticket d on d.org_id = a.org_id
  left join lookup_month lm on lm.code =a.operation_date 
  left join lookup_weeks lw on lw.code =a.operation_date
  left join lookup_quarter lq on lq.code =a.operation_date
  left join lookup_year ly on ly.code =a.operation_date
  where
  a.equity_structure is not null
  and
  business_name_two is not null
  and
  c.description is not null
  and
  ((a.business_name_two = $P{woman_status}) or ($P{woman_status} = ' '))
  and
  ((a.industry_temp_code = $P{industry_group}) or($P{industry_group} = -1))
  and
  (((case when a.sic_description = 1 then 'BUMIPUTERA'
       when a.sic_description = 2 then 'NON BUMIPUTERA' end ) = $P{equity_structure}) or ($P{equity_structure} = ' '))
  and
  ((a.operation_date BETWEEN convert(datetime,$P{date_start},103) AND convert(datetime,$P{date_end},103))
  or (convert(datetime,$P{date_start},103) =' ' AND convert(datetime,$P{date_end},103) = ' '))
  
  AND
  ((lm.code = $P{lookup_month}) or ($P{lookup_month} = -1)) 
  AND
  ((ly.code = $P{lookup_year}) or ($P{lookup_year} = -1))
  AND
  ((lq.code = $P{lookup_quarter}) or ($P{lookup_quarter} = -1))
  AND
  ((lw.code = $P{lookup_weeks}) or ($P{lookup_weeks} = -1))]]&gt;&lt;/queryString&gt;
  
      &lt;field name="daterange" class="java.lang.String"/&gt;
      &lt;field name="org_id" class="java.lang.Integer"/&gt;
      &lt;field name="name" class="java.lang.String"/&gt;
      &lt;field name="business_name_two" class="java.lang.String"/&gt;
      &lt;field name="organization_type" class="java.lang.String"/&gt;
      &lt;field name="companygroup" class="java.lang.String"/&gt;
      &lt;field name="lead" class="java.lang.String"/&gt;
      &lt;field name="industry_temp_code" class="java.lang.Integer"/&gt;
      &lt;field name="description" class="java.lang.String"/&gt;
      &lt;field name="equity_structure" class="java.lang.String"/&gt;
      &lt;field name="race" class="java.lang.String"/&gt;
      &lt;field name="dateregister" class="java.lang.String"/&gt;
  
          &lt;background&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/background&gt;
          &lt;title&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/title&gt;
          &lt;pageHeader&gt;
              &lt;band height="187"  isSplitAllowed="true" &gt;
                  &lt;staticText&gt;
                      &lt;reportElement
                          x="0"
                          y="0"
                          width="802"
                          height="18"
                          key="staticText"/&gt;
                      &lt;box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/&gt;
                      &lt;textElement textAlignment="Center"&gt;
                          &lt;font fontName="SansSerif" size="12" isBold="true"/&gt;
                      &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Date Registered
  ]]&gt;&lt;/text&gt;
                  &lt;/staticText&gt;
                  &lt;textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" &gt;
                      &lt;reportElement
                          x="0"
                          y="54"
                          width="802"
                          height="42"
                          key="textField-1"
                          isRemoveLineWhenBlank="true"/&gt;
                      &lt;box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/&gt;
                      &lt;textElement textAlignment="Left" verticalAlignment="Top" rotation="None" isStyledText="true" lineSpacing="1_1_2"&gt;
                          &lt;font size="11" isBold="true"/&gt;
                      &lt;/textElement&gt;
                  &lt;textFieldExpression   class="java.lang.String"&gt;&lt;![CDATA[($P{date_start}!= null) &amp;&amp; ($P{date_end}!=null) &amp;&amp; ($P{lookup_month}!= -1) &amp;&amp; ($P{lookup_year}!=-1)&amp;&amp; ($P{lookup_quarter}!= -1) &amp;&amp; ($P{lookup_weeks}!=-1) ? "Date Ticket Created From : " + new SimpleDateFormat("dd/MM/yyyy").format($P{date_start}) +"\n" + "Date Ticket Created to : " + new SimpleDateFormat("dd/MM/yyyy").format($P{date_end})
  : null]]&gt;&lt;/textFieldExpression&gt;
                  &lt;/textField&gt;
                  &lt;textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" &gt;
                      &lt;reportElement
                          x="0"
                          y="20"
                          width="802"
                          height="35"
                          key="textField-2"
                          isRemoveLineWhenBlank="true"/&gt;
                      &lt;box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/&gt;
                      &lt;textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single"&gt;
                          &lt;font size="12" isBold="true"/&gt;
                      &lt;/textElement&gt;
                  &lt;textFieldExpression   class="java.lang.String"&gt;&lt;![CDATA[($P{date_start}!= null) &amp;&amp; ($P{date_end}!=null) &amp;&amp; ($P{lookup_month}== -1) &amp;&amp; ($P{lookup_year}==-1)&amp;&amp; ($P{lookup_quarter}== -1) &amp;&amp; ($P{lookup_weeks}==-1)? " From ( " + new SimpleDateFormat("dd/MM/yyyy").format($P{date_start}) + " - " + new SimpleDateFormat("dd/MM/yyyy").format($P{date_end}) + " )"
  :($P{date_start}== null) &amp;&amp; ($P{date_end}==null) &amp;&amp; ($P{lookup_month}!= -1) &amp;&amp; ($P{lookup_year}!=-1)&amp;&amp; ($P{lookup_quarter}== -1) &amp;&amp; ($P{lookup_weeks}!=-1)? "For week " + $P{lookup_weeks} +" "+ $P{lookup_month} +" "+ $P{lookup_year}
  :($P{date_start}== null) &amp;&amp; ($P{date_end}==null) &amp;&amp; ($P{lookup_month}!= -1) &amp;&amp; ($P{lookup_year}!=-1)&amp;&amp; ($P{lookup_quarter}== -1) &amp;&amp; ($P{lookup_weeks}==-1)? "For monthly " +$P{lookup_month} +" "+ $P{lookup_year}
  :($P{date_start}== null) &amp;&amp; ($P{date_end}==null) &amp;&amp; ($P{lookup_month}== -1) &amp;&amp; ($P{lookup_year}!=-1)&amp;&amp; ($P{lookup_quarter}!= -1) &amp;&amp; ($P{lookup_weeks}==-1)? "For Quarter " + $P{lookup_quarter} +" "+$P{lookup_year}
  :($P{date_start}== null) &amp;&amp; ($P{date_end}==null) &amp;&amp; ($P{lookup_month}== -1) &amp;&amp; ($P{lookup_year}!=-1)&amp;&amp; ($P{lookup_quarter}== -1) &amp;&amp; ($P{lookup_weeks}==-1)? "For Year " + $P{lookup_year}
  : $P{lookup_year}]]&gt;&lt;/textFieldExpression&gt;
                  &lt;/textField&gt;
              &lt;/band&gt;
          &lt;/pageHeader&gt;
          &lt;columnHeader&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/columnHeader&gt;
          &lt;detail&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/detail&gt;
          &lt;columnFooter&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/columnFooter&gt;
          &lt;pageFooter&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/pageFooter&gt;
          &lt;summary&gt;
              &lt;band height="0"  isSplitAllowed="true" &gt;
              &lt;/band&gt;
          &lt;/summary&gt;
  &lt;/jasperReport&gt;
  </code></pre>