title: How To Pass a JRBeanCollectionDataSource to iReport?
body: <p>I'm currently trying to use jasper to help me create reports. I have the information and data that I want displayed in this method:</p>
  
  <pre><code>private void writeToFile(final List&lt;ScenarioLoadModel&gt; sceneLoadModel) throws Exception {
    final BufferedWriter bw = new BufferedWriter(new FileWriter("/Uma/nft/result.psv"));
  
    for (final ScenarioLoadModel slm : sceneLoadModel) {
      bw.write(slm.getScenarioId() + PSP + slm.getScenarioId() + PSP + slm.getScenarioConfig().getName() + PSP + slm.getLoad() + PSP + "" + EOL);
      if (!slm.getScenarios().isEmpty()) {
        final int tempCount = slm.getScenarios().get(0).getTemplates().size();
        final int sceneCount = slm.getScenarios().size();
        for (int tempIdx = 0; tempIdx &lt; tempCount; tempIdx++) {
          String id = null;
          int pass = 0;
          int fail = 0;
          final Map&lt;String, BigDecimal&gt; metricMap = new HashMap&lt;String, BigDecimal&gt;();
          final DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
          for (int sceneIdx = 0; sceneIdx &lt; sceneCount; sceneIdx++) {
            final Template temp = slm.getScenarios().get(sceneIdx).getTemplates().get(tempIdx);
            if (temp.isError()) {
              fail++;
            } else {
              pass++;
            }
            if (sceneIdx == 0) {
              id = temp.getId();
            }
            final MetricGroupModel mgm = slm.getScenarios().get(sceneIdx).getMetricGroupModel().get(tempIdx);
            if (mgm != null) {
              for (final MetricModel mm : mgm.getMetricModel()) {
                for (final MetricValue mv : mm.getMetricValue()) {
                  dataset.add(mv.getValue(), new BigDecimal(0.0), mv.getType(), id);
                }
              }
            }
          }
          final TemplateConfig tc = TemplateManager.getTemplateConfig(id);
  
          bw.write(slm.getScenarioId() + PSP);
          bw.write(id + PSP + tc.getName() + PSP + 1 + PSP + pass + "/" + fail);
          for (final Object row : dataset.getRowKeys()) {
            final Number mean = dataset.getValue((String) row, id);
            bw.write(PSP + row + PSP + mean);
          }
          bw.write(EOL);
        }
      }
    }
  
    bw.close();
  }
  </code></pre>
  
  <p>From my understanding I create Beans and then put them all in a Bean Factory, to create my object that will be ready to be passed to iReport.</p>
  
  <p>How can I put all this information into a Bean?  I essentially want the bean to include the scenario/test case and whether or not it passed. (This is for test automation)</p>