public void export(HttpServletRequest req, HttpServletResponse res) throws Exception { String fileName=this.getExportFileName(req); fileName+=".pptx"; res.setContentType("application/octet-stream"); res.setHeader("Connection", "close"); res.setHeader("Content-Disposition", "attachment;filename=\"" + new String(fileName.getBytes("utf-8"),"ISO-8859-1") + "\""); JRPptxExporter exporter = new JRPptxExporter(DefaultJasperReportsContext.getInstance()); JasperPrint jasperPrint=this.getJasperPrint(req); exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint); OutputStream ouputStream = res.getOutputStream(); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream); try { exporter.exportReport(); } catch (JRException e) { throw new ServletException(e); } finally { if (ouputStream != null) { ouputStream.flush(); ouputStream.close(); } } }
/** * */ public void pptx() throws JRException { File[] files = getFiles(new File("build/reports"), "jrprint"); for(int i = 0; i < files.length; i++) { long start = System.currentTimeMillis(); File sourceFile = files[i]; JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("Report : " + sourceFile + ". PPTX creation time : " + (System.currentTimeMillis() - start)); } }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/ScriptletReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); SimplePptxReportConfiguration configuration = new SimplePptxReportConfiguration(); configuration.setProgressMonitor(new SimpleExportProgressMonitor()); exporter.setConfiguration(configuration); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); List<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>(); jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report1.jrprint")); jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report2.jrprint")); jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report3.jrprint")); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput("build/reports/BatchExportReport.pptx")); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
@Override public void exportElement( JRPptxExporterContext exporterContext, JRGenericPrintElement element ) { try { JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporterRef(); exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element)); } catch (Exception e) { throw new RuntimeException(e); } }
private Exporter createExporter(ExportType type) { switch (type) { case CSV: return new JRCsvExporter(); case RTF: return new JRRtfExporter(); case XLS: return new JRXlsExporter(); case ODT: return new JROdtExporter(); case ODS: return new JROdsExporter(); case DOCX: return new JRDocxExporter(); case XLSX: return new JRXlsxExporter(); case PPTX: return new JRPptxExporter(); default: return null; } }
public void exportElement( JRPptxExporterContext exporterContext, JRGenericPrintElement element ) { JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporterRef(); JRPrintText text = getTextElementReplacement(exporterContext, element); exporter.exportText(text); }
@Override public void exportElement(JRPptxExporterContext exporterContext, JRGenericPrintElement element) { JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporterRef(); try { HtmlPrintElement htmlPrintElement = HtmlPrintElementUtils.getHtmlPrintElement(); exporter.exportImage(htmlPrintElement.createImageFromElement(element)); } catch (JRException e) { throw new RuntimeException(e); } }
public void exportPptx() throws JRException { JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput( this.output.getAbsolutePath() + ".pptx")); exporter.exportReport(); }
@Override protected JRPptxExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) { JRPptxExporter exp = new JRPptxExporter(jContext); exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file)); SimplePptxReportConfiguration rconf = new SimplePptxReportConfiguration(); setupReportConfiguration(rconf, monitor); exp.setConfiguration(rconf); return exp; }
/** * Exports by MIME type. * * @param mimeType MIME type * @param jp Jasper print * @param os outputstream * @throws JRException */ protected void export(String mimeType, JasperPrint jp, OutputStream os) throws JRException { if ("application/pdf".equalsIgnoreCase(mimeType)) { exportReport(new JRPdfExporter(), jp, os); } else if ("text/xml".equalsIgnoreCase(mimeType)) { exportReport(new HtmlExporter(), jp, os); } else if ("application/rtf".equalsIgnoreCase(mimeType)) { exportReport(new JRRtfExporter(), jp, os); } else if ("application/xls".equalsIgnoreCase(mimeType)) { exportReport(new JRXlsExporter(), jp, os); } else if ("application/odt".equalsIgnoreCase(mimeType)) { exportReport(new JROdtExporter(), jp, os); } else if ("application/ods".equalsIgnoreCase(mimeType)) { exportReport(new JROdsExporter(), jp, os); } else if ("application/docx".equalsIgnoreCase(mimeType)) { exportReport(new JRDocxExporter(), jp, os); } else if ("application/xlsx".equalsIgnoreCase(mimeType)) { exportReport(new JRXlsxExporter(), jp, os); } else if ("application/pptx".equalsIgnoreCase(mimeType)) { exportReport(new JRPptxExporter(), jp, os); } else if ("text/xhmtl".equalsIgnoreCase(mimeType)) { exportReport(new JRXhtmlExporter(), jp, os); } else { throw new IllegalArgumentException("JasperRenderer does not support " + mimeType + " MIME type."); } }
private JRPptxExporter pptx(JasperIPptxExporter jasperExporter) { SimpleOutputStreamExporterOutput exporterOutput = simpleOutputStreamExporterOutput(jasperExporter); SimplePptxReportConfiguration reportExportConfiguration = new SimplePptxReportConfiguration(); reportExportConfiguration(reportExportConfiguration, jasperExporter); if (jasperExporter.getIgnoreHyperLink() != null) { reportExportConfiguration.setIgnoreHyperlink(jasperExporter.getIgnoreHyperLink()); } SimplePptxExporterConfiguration exporterConfiguration = new SimplePptxExporterConfiguration(); JRPptxExporter jrExporter = new JRPptxExporter(); jrExporter.setExporterOutput(exporterOutput); jrExporter.setConfiguration(reportExportConfiguration); jrExporter.setConfiguration(exporterConfiguration); return jrExporter; }
@Override public void exportElement(JRPptxExporterContext exporterContext, JRGenericPrintElement element) { try { JRPptxExporter exporter = (JRPptxExporter) exporterContext.getExporter(); exporter.exportImage(getImage(exporterContext, element)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/UnicodeReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/BookReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/Barcode4JReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/DataSourceReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/FontsReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/FormsReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/StyledTextReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/MapReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/TabularReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/XYChart.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/QueryReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/ShapesReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/CustomersReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/MasterReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/NoXmlDesignReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/NoPageBreakReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/XlsDataSourceReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/HorizontalReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/HyperlinkReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/MarkupReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/StylesReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/ImagesReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }
/** * */ public void pptx() throws JRException { long start = System.currentTimeMillis(); File sourceFile = new File("build/reports/JsonCustomersReport.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pptx"); JRPptxExporter exporter = new JRPptxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); exporter.exportReport(); System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start)); }