Package net.sf.jasperreports.engine.export

Examples of net.sf.jasperreports.engine.export.JRXlsExporter


            if (jp.getPages().size() < 1) {
                throw new ViewHandlerException("Report is Empty (no results?)");
            } else {
                Debug.logInfo("Got report, there are " + jp.getPages().size() + " pages.", module);
            }
           JRXlsExporter exporter = new JRXlsExporter();
           exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jp);
           exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, response.getOutputStream());
           exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
           exporter.exportReport();

        } catch (IOException ie) {
            throw new ViewHandlerException("IO Error in report", ie);
        } catch (java.sql.SQLException e) {
            throw new ViewHandlerException("Database error while running report", e);
View Full Code Here


                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                request.getSession().setAttribute("net.sf.jasperreports.j2ee.jasper_print", jasperPrint);
            } else if (format.equals(FORMAT_XLS)) {
                response.setContentType("application/vnd.ms-excel");
                exporter = new JRXlsExporter();
            } else if (format.equals(FORMAT_XML)) {
                response.setContentType("text/xml");
                exporter = new JRXmlExporter();
            } else if (format.equals(FORMAT_RTF)) {
                response.setContentType("application/rtf");
View Full Code Here

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                request.getSession().setAttribute("net.sf.jasperreports.j2ee.jasper_print", jasperPrint);
            } else if (format.equals(FORMAT_XLS)) {
                response.setContentType("application/vnd.ms-excel");
                exporter = new JRXlsExporter();
            } else if (format.equals(FORMAT_XML)) {
                response.setContentType("text/xml");
                exporter = new JRXmlExporter();
            } else if (format.equals(FORMAT_RTF)) {
                response.setContentType("application/rtf");
View Full Code Here

        return "xls";
    }

    @Override
    protected void doExport(final OutputStream outputStream, final Print print) throws JRException {
        JRXlsExporter exporter = new JRXlsExporter();
        exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);

        exporter.exportReport();
    }
View Full Code Here

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                request.getSession().setAttribute("net.sf.jasperreports.j2ee.jasper_print", jasperPrint);
            } else if (format.equals(FORMAT_XLS)) {
                response.setContentType("application/vnd.ms-excel");
                exporter = new JRXlsExporter();
            } else if (format.equals(FORMAT_XML)) {
                response.setContentType("text/xml");
                exporter = new JRXmlExporter();
            } else if (format.equals(FORMAT_RTF)) {
                response.setContentType("application/rtf");
View Full Code Here

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                request.getSession().setAttribute("net.sf.jasperreports.j2ee.jasper_print", jasperPrint);
            } else if (format.equals(FORMAT_XLS)) {
                response.setContentType("application/vnd.ms-excel");
                exporter = new JRXlsExporter();
            } else if (format.equals(FORMAT_XML)) {
                response.setContentType("text/xml");
                exporter = new JRXmlExporter();
            } else if (format.equals(FORMAT_RTF)) {
                response.setContentType("application/rtf");
View Full Code Here

    setContentType("application/vnd.ms-excel");
  }

  @Override
  protected net.sf.jasperreports.engine.JRExporter createExporter() {
    return new JRXlsExporter();
  }
View Full Code Here

   */
  public static void renderAsXls(JasperReport report, Map<String, Object> parameters, Object reportData,
      OutputStream stream) throws JRException {

    JasperPrint print = JasperFillManager.fillReport(report, parameters, convertReportData(reportData));
    render(new JRXlsExporter(), print, stream);
  }
View Full Code Here

  public static void renderAsXls(JasperReport report, Map<String, Object> parameters, Object reportData,
      OutputStream stream, Map<net.sf.jasperreports.engine.JRExporterParameter, Object> exporterParameters)
      throws JRException {

    JasperPrint print = JasperFillManager.fillReport(report, parameters, convertReportData(reportData));
    JRXlsExporter exporter = new JRXlsExporter();
    exporter.setParameters(exporterParameters);
    render(exporter, print, stream);
  }
View Full Code Here

    setContentType("application/vnd.ms-excel");
  }

  @Override
  protected JRExporter createExporter() {
    return new JRXlsExporter();
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.JRXlsExporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.