Package net.sf.jasperreports.engine.export

Examples of net.sf.jasperreports.engine.export.JRCsvExporter.exportReport()


    JRCsvExporter exporter = new JRCsvExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
   
    exporter.exportReport();

    System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
  }
 
 
View Full Code Here


    JRCsvExporter exporter = new JRCsvExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
   
    exporter.exportReport();

    System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
  }
 
 
View Full Code Here

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        JRExporter exporter = new JRCsvExporter();

        exporter.setParameter(JRExporterParameter.JASPER_PRINT, reportPrint);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, buf);
        exporter.exportReport();
        outReport.setContent(buf.toByteArray());
      }
      else if ("csv".equals(reportFormat))
      {
        res.addOutput("contentType", "text/xml");
View Full Code Here

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        JRExporter exporter = new JRXmlExporter();

        exporter.setParameter(JRExporterParameter.JASPER_PRINT, reportPrint);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, buf);
        exporter.exportReport();
        outReport.setContent(buf.toByteArray());
      }
      else if ("xls".equals(reportFormat))
      {
        res.addOutput("contentType", "application/xls");
View Full Code Here

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        JRExporter exporter = new JRXlsExporter();

        exporter.setParameter(JRExporterParameter.JASPER_PRINT, reportPrint);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, buf);
        exporter.exportReport();
        outReport.setContent(buf.toByteArray());
      }
      else
      {
        StringBuffer buf = new StringBuffer();
View Full Code Here

        exporter.setParameter(JRHtmlExporterParameter.HTML_HEADER, "");
        exporter.setParameter(JRHtmlExporterParameter.HTML_FOOTER, "");
        exporter.setParameter(JRHtmlExporterParameter.BETWEEN_PAGES_HTML, "");
        exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, new Boolean(true));
        exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(page - 1));
        exporter.exportReport();
        outReport.setContent(buf.toString());

        createPageNavigationControls(req, res, page, reportPrint.getPages().size(), backModel);
      }
    }
View Full Code Here

    p.put(JRExporterParameter.JASPER_PRINT, jasperPrint);
    p.put(JRExporterParameter.OUTPUT_FILE_NAME, path + "/" + fileName);

    exporter.setParameters(p);
    exporter.exportReport();
  }

  public static void createXMLReport(InputStream reportFile, GridReportVO gridReportVO,
      OutputStream os) throws JRException, IOException {
    gridReportVO.setPagination(true);
View Full Code Here

        case CSV:
          logger.debug(bundle.getString("exporting-report", "csv"));
          JRCsvExporter exporterCSV = new JRCsvExporter();
          exporterCSV.setParameter(JRCsvExporterParameter.JASPER_PRINT, print);
          exporterCSV.setParameter(JRCsvExporterParameter.OUTPUT_STREAM, outputStream);
          exporterCSV.exportReport();
          break;
        case HTML:
          logger.debug(bundle.getString("exporting-report", "html"));
          JRHtmlExporter exporterHTML = new JRHtmlExporter();
          exporterHTML.setParameter(JRHtmlExporterParameter.JASPER_PRINT, print);
View Full Code Here

        case CSV:
          logger.debug(bundle.getString("exporting-report", "csv"));
          JRCsvExporter exporterCSV = new JRCsvExporter();
          exporterCSV.setParameter(JRCsvExporterParameter.JASPER_PRINT, print);
          exporterCSV.setParameter(JRCsvExporterParameter.OUTPUT_STREAM, outputStream);
          exporterCSV.exportReport();
          break;
        case HTML:
          logger.debug(bundle.getString("exporting-report", "html"));
          JRHtmlExporter exporterHTML = new JRHtmlExporter();
          exporterHTML.setParameter(JRHtmlExporterParameter.JASPER_PRINT, print);
View Full Code Here

                                outStream.write(b);
        JRExporter csvExporter = new JRCsvExporter();
        csvExporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
        csvExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputByteArray);
        csvExporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8");
        csvExporter.exportReport();
                                outStream.write(outputByteArray.toByteArray());
      } else
      if (outputFormat.compareToIgnoreCase("XLS") == 0)
      {
                                returnResult = tempFolder + "readonly.xls";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.