title: How to avoid error parsing empty text field for getting Date in Jasperreports
body: <p>When I parse text field to get Date it's OK.
  But if this text field is null because no data in the database, I am getting an exception.
  How to get it work even if field is empty?</p>
  
  <p>I use:
  Jasperreports 5.6 via API, so I get my exceptions not in iReport, but while executing my java code;
  Initial source of text field is oracle.Timestamp</p>
  
  <p>Like described <a href="https://stackoverflow.com/questions/3177323/how-to-avoid-null-values-in-jasper-reports">here</a> I tried to insert following:</p>
  
  <pre><code>$F{INCLUDE_TIME} == null ? "" : new java.text.SimpleDateFormat("MMMM dd, yyyy HH:mm").format(new java.text.SimpleDateFormat("yyyy-MM-dd.HH.mm. ss.").parse($F{INCLUDE_TIME}))
  </code></pre>
  
  <p>But this works if I generate my report with iReport, and fails when I do it via API from Java code, using jasperreports engine.    </p>
  
  <p>The field is:</p>
  
  <pre><code>&lt;field name="INCLUDE_TIME" class="java.lang.String"/&gt;
  </code></pre>
  
  <p>My exception is:</p>
  
  <blockquote>
    <p>18:19:53,564 ERROR Got exception while in generateReport:
    net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error
    evaluating expression :   Source text : new
    java.text.SimpleDateFormat("MMMM dd, yyyy HH:mm").format(new
    java.text.SimpleDateFormat("yyyy-MM-dd.HH.mm.
    ss.").parse(""+$F{INCLUDE_TIME}))</p>
  </blockquote>