title: net.sf.jasperreports.engine.JRException: No input source supplied to the exporter
body: <p>I have a Exception. 
  "net.sf.jasperreports.engine.JRException: No input source supplied to the exporter".</p>
  
  <p>the Source Code (in the jsp file):</p>
  
  <pre><code>try {
      CustomerReport report = new CustomerReport();
      report.setReportType((Integer) session.getAttribute("reportType"));
      report.setEndTime((String) session.getAttribute("endTime"));
      report.setBeginTime((String) session.getAttribute("beginTime"));
      List&lt;CustomerStatistics&gt; stasList =
              (List&lt;CustomerStatistics&gt;) session.getAttribute("stasList");
      dataSize = stasList.size();
      ds = report.getDataSource(stasList).toString();
      JasperPrint print = report.getPrint(stasList);
  
      JRHtmlExporter exporter = new JRHtmlExporter();
      session.setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, print);
      exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
      exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);
      exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, true);
      exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image=");
  
      exporter.exportReport();
  } catch (Exception e) {
      logger.error(this.getClass(), e);
  }
  </code></pre>
  
  <p>The CustomerReport code:</p>
  
  <pre><code>public JasperPrint getPrint(List&lt;CustomerStatistics&gt; stasList) {
      JasperPrint print = null;
      FontBuilder boldFont = stl.fontArialBold().setFontSize(12).setFontName("SansSerif");
      TextColumnBuilder&lt;String&gt; areaNameColumn = col.column("区域", "areaName", type.stringType());
      TextColumnBuilder&lt;Integer&gt; businessConsultColumn = col.column("业务咨询", "businessConsultSum", type.integerType());
      TextColumnBuilder&lt;Integer&gt; openReserveColumn = col.column("开通预约", "openReserveSum", type.integerType());
      TextColumnBuilder&lt;Integer&gt; complainAcceptColumn = col.column("投诉受理", "complainAcceptSum", type.integerType());
  
      try {
          print = report()
                  .setPageFormat(900, 600, PageOrientation.PORTRAIT)
                  .setTemplate(Templates.reportTemplate)
                  .title(Templates.createTitleComponent(title + "   [ " + beginTime + " 至 " + endTime + " ]"))
                  .summary(
                          cht.bar3DChart()
                                  .setShowValues(true)
                                  .setTitleFont(boldFont)
                                  .setCategory(areaNameColumn)
                                  .series(cht.serie(businessConsultColumn), cht.serie(openReserveColumn), cht.serie(complainAcceptColumn))
                                  .setCategoryAxisFormat(
                                          cht.axisFormat().setLabel("区域"))
                  )
                  .pageFooter(Templates.footerComponent)
                  .setDataSource(getDataSource(stasList))
                  .toJasperPrint();
  
  
      } catch (Exception e) {
          logger.error("________________****   getPrint()   ***____________________");
          logger.error(this.getClass(), e);
      }
  
  public JRDataSource getDataSource(List&lt;CustomerStatistics&gt; stasList) {
      DRDataSource ds =
              new DRDataSource("areaName", "businessConsultSum", "openReserveSum", "complainAcceptSum");
      for (CustomerStatistics stas : stasList) {
  
          ds.add(stas.getAreaName(), stas.getBusinessConsultSum(),
                  stas.getOpenReserveSum(), stas.getComplainAcceptSum());
      }
  
      return ds;
  }
  </code></pre>
  
  <p>The Action function source code:</p>
  
  <pre><code>stasList=customerStatisticsService.getCustomerStatisList(map);
  if(stasList==null||stasList.size()&lt;=0)  {
      isNoData = true;
      noDataHide = true;
  }
  
  HttpSession session = ServletActionContext.getRequest()
          .getSession();
  session.setAttribute("reportType",reportType);
  session.setAttribute("stasList",stasList);
  session.setAttribute("reportTitle",reportTitle);
  session.setAttribute("beginTime",beginTime);
  session.setAttribute("endTime",endTime);
  String dir = System.getProperty("user.dir");
  session.setAttribute("dir",dir);
  </code></pre>