title: Printing jsf ArrayLIst via Jasper Report using JRBeanCollectionDataSource
body: <p>I'm using a jsf array list to retrieve records based on some criteria. Now I want contents of this array list to be print via Jasper report. I followed following steps.</p>
  
  <ol>
  <li>Used empty datasource in Jasper report.</li>
  <li>Created Fields in jasper reports as those of my bean properties.</li>
  <li>Then I compiled the report to <strong><em>employeeList.jasper</em></strong> and placed that in my <strong><em>/reports
      /employeeReports/employeeList.jasper</em></strong> folder in jsf project (I'm using Eclipse).</li>
  </ol>
  
  <p>I have then used following code to fill and show the pdf report    </p>
  
  <pre><code>JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(this.srchdEmployeesList);
  try {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      HttpServletResponse response =
              (HttpServletResponse) facesContext.getExternalContext().getResponse();
      HashMap parameterMap = new HashMap();
      JasperFillManager.fillReportToFile("/reports/employeeReports/employeeList.jasper", parameterMap, dataSource);
      InputStream reportStream = facesContext.getExternalContext().getResourceAsStream("/reports/employessReports/employeeList.jasper");
      ServletOutputStream servletOutputStream = response.getOutputStream();
      Class.forName("oracle.jdbc.driver.OracleDriver");
      Session hibernateSession = null;
      hibernateSession = HibernateUtils.currentSession();
      connection = hibernateSession.connection();
      facesContext.responseComplete();
      response.setContentType("application/pdf");
      response.setHeader("Content-disposition", "attachment;");
      JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, parameterMap, connection);
  
      connection.close();
      servletOutputStream.flush();
      servletOutputStream.close();
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>I recieve following error message and report do not show up</p>
  
  <pre><code>  net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: \reports
    \employeeReports\employeeList.jasper
  Caused by: java.io.FileNotFoundException: \reports\employeeReports
     \employeeList.jasper ... 34 more
  </code></pre>
  
  <p>Help in this regard would be highly appreciated. Bundles of thanks in advance.</p>