title: How to pass parameter to the table component?
body: <p>I am using Jaspersoft Studio to create the reports and I found a problem passing the parameters to a table. </p>
  
  <p><strong>Report layout and result</strong></p>
  
  <p><a href="https://i.stack.imgur.com/tZtNVm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tZtNVm.png" alt="Report layout"></a> <a href="https://i.stack.imgur.com/SvkxOm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SvkxOm.png" alt="Result"></a></p>
  
  <p>As you can see in these pictures, when I try to use the parameters to set the table headers I get <code>null</code>.</p>
  
  <p>In order to get the values, I created the same parameter names in both, the report parameters list and the tables dataset parameters list. Obviously, it didn't work at all.</p>
  
  <p>I tried to follow these instructions: <a href="http://www.vikramtakkar.com/2013/03/jaspersoft-passing-parameter-to-tables.html" rel="noreferrer">jaspersoft-passing-parameter-to-tables</a></p>
  
  <p>But my datasource is from a <code>net.sf.jasperreports.engine.data.JRBeanCollectionDataSource</code> parameter and I couldn't find the way to complete the tutorial successfully.</p>
  
  <p><strong>Relevant code:</strong></p>
  
  <pre><code>&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="subreport" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="19165c65-293a-42f1-9c92-0f4ceacaaa39"&gt;
    .....
    &lt;subDataset name="ATableDataset" uuid="f7f9da25-c513-46bb-92c2-5a97ee76eb5e"&gt;
      &lt;parameter name="tableHeadA" class="java.lang.String"/&gt;
      &lt;parameter name="column1AHead" class="java.lang.String"/&gt;
      &lt;parameter name="column2AHead" class="java.lang.String"/&gt;
      &lt;parameter name="column3AHead" class="java.lang.String"/&gt;
      &lt;queryString&gt;
          &lt;![CDATA[]]&gt;
      &lt;/queryString&gt;
      &lt;field name="column1A" class="java.lang.String"/&gt;
      &lt;field name="column2A" class="java.lang.String"/&gt;
      &lt;field name="column3A" class="java.lang.String"/&gt;
    &lt;/subDataset&gt;
     .....
    &lt;jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"&gt;
      &lt;datasetRun subDataset="ATableDataset" uuid="8ac10f33-c9e3-4678-8280-2830a76f72c6"&gt;
      &lt;dataSourceExpression&gt;&lt;![CDATA[$P{AtableDatasource}]]&gt;&lt;/dataSourceExpression&gt;
     &lt;/datasetRun&gt;
      ....
  &lt;/jr:table&gt;
  ......
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>Full code see <a href="https://github.com/MichaelKnight/jaspertest.git" rel="noreferrer">gitHub</a>, <code>sample\src\main\resources\subreport.jrxml</code></p>