title: Why do I get current expression is not valid using JRDataSource?
body: <p>I am trying to use List into the jasper report using JasperSoft Studio, but while defining dataset the JRDataSource expression is showing as invalid even after casting <code>REPORT_DATA_SOURCE</code> to the <code>JRXmlDataSource</code>(find image below).</p>
  
  <p><strong>Expression</strong></p>
  
  <pre><code>((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Header/FileName")
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>The current expression is not valid. Please verify it!</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/5OLck.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5OLck.png" alt="Output"></a></p>
  
  <p>The error is looking so weird and I am not able understand it what is wrong here.</p>