title: How to Pass JR Bean Data Source only to subreport and JREmptyData Source to master IReport
body: <p>I a new to jasper report and i am not getting how to pass JRBeanCollectionDataSource only to subreport and JREmptyDataSource to master ireport.</p>
  
  <p>I have one java bean class usingbean having properties compet and compet_name with getter and setter methods.</p>
  
  <p>In my master report i have one field name as dataBeanList which is the Arraylist of type usingbean and field property is set to type list. </p>
  
  <p>My subreport is having two fields named as compet and compet_name...</p>
  
  <pre><code>   &lt;subreport&gt;
                      &lt;reportElement uuid="0db7b8b7-9cf5-41fc-b271-ffb6333c80f3" x="129" y="30" width="200" height="100"/&gt;
                      &lt;dataSourceExpression&gt;&lt;![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{dataBeanList})]]&gt;&lt;/dataSourceExpression&gt;
                      &lt;subreportExpression&gt;&lt;![CDATA[$P{SUBREPORT_DIR} + "subreport1.jasper"]]&gt;&lt;/subreportExpression&gt;
                  &lt;/subreport&gt;
  </code></pre>
  
  <p>My java code is...</p>
  
  <pre><code>   try
          {
  
               Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
  
              newpdftemplate newpdftemplate = new newpdftemplate();
              ArrayList&lt;usingbean&gt; dataBeanList = newpdftemplate.getDataBeanList();
  
              JRBeanCollectionDataSource beanColDataSource = new
              JRBeanCollectionDataSource(dataBeanList);
  jasperDesign = JRXmlLoader.load("D:/workspace/itxtgraph/jrxml/FirstReport.jrxml");
          jasperReport = JasperCompileManager.compileReport(jasperDesign);
  parameters.put("SUBREPORT_DIR", "D:/workspace/itxtgraph/jrxml/");
           jasperPrint = JasperFillManager.fillReport(jasperReport,parameters, new JREmptyDataSource());
          JasperExportManager.exportReportToPdfFile(jasperPrint,
          "D:/workspace/itxtgraph/report/SecondReport.pdf");
          response.setContentType("application/pdf");
  }
  </code></pre>
  
  <p>My master report is getting filled but subreport is empty with static texts..
  Please tell me where i am doing mistakes</p>
  
  <p>error is:</p>
  
  <pre><code> 13 Nov, 2013 4:44:31 PM net.sf.jasperreports.engine.fill.JRFillSubreport prepare
  SEVERE: Fill 1: exception
  net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : 
      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:123)
      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)
      at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:100)
      at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1331)
      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1232)
      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1208)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1577)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:149)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)
      at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:655)
      at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
      at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: java.lang.NoSuchMethodException: Unknown property '' on class 'class itxtgraph.usingbean'
      at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1313)
      at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762)
      at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837)
      at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)
      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:111)
      ... 15 more
  </code></pre>
  
  <blockquote>
    <p>why each element of array list is displaying in new page if bean fields are directly taken in main report</p>
  </blockquote>