public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }
public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleOutputStreamExporterOutput(output); }
public ReportExportConfiguration getReportConfiguration() { reportConfiguration.setIgnoreGraphics(Boolean.FALSE); reportConfiguration.setCollapseRowSpan(Boolean.FALSE); reportConfiguration.setDetectCellType(Boolean.TRUE); reportConfiguration.setFontSizeFixEnabled(Boolean.TRUE); reportConfiguration.setRemoveEmptySpaceBetweenColumns(Boolean.FALSE); reportConfiguration.setRemoveEmptySpaceBetweenRows(Boolean.FALSE); reportConfiguration.setIgnoreCellBorder(Boolean.FALSE); reportConfiguration.setImageBorderFixEnabled(Boolean.FALSE); reportConfiguration.setShowGridLines(Boolean.FALSE); reportConfiguration.setIgnoreCellBackground(Boolean.FALSE); reportConfiguration.setWrapText(Boolean.FALSE); reportConfiguration.setOnePagePerSheet(Boolean.TRUE); reportConfiguration.setColumnWidthRatio(1.25f); return reportConfiguration; }
/** * Export to EXCEL * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toExcel() throws JRException { JRXlsxExporter jrXlsxExporter = new JRXlsxExporter(); jrXlsxExporter.setExporterInput(new SimpleExporterInput(this.report)); jrXlsxExporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(getTemplatePath().replace(extensionPattern, "xlsx")))); jrXlsxExporter.exportReport(); return this; }
public static void exportReportHtml(JasperPrint jp, String path) throws JRException, FileNotFoundException { HtmlExporter exporter = new HtmlExporter(); File outputFile = new File(path); File parentFile = outputFile.getParentFile(); if (parentFile != null) parentFile.mkdirs(); FileOutputStream fos = new FileOutputStream(outputFile); SimpleExporterInput simpleExporterInput = new SimpleExporterInput(jp); SimpleHtmlExporterOutput simpleOutputStreamExporterOutput = new SimpleHtmlExporterOutput(fos); exporter.setExporterInput(simpleExporterInput); exporter.setExporterOutput(simpleOutputStreamExporterOutput); SimpleHtmlExporterConfiguration configuration = new SimpleHtmlExporterConfiguration(); exporter.setConfiguration(configuration); exporter.exportReport(); logger.debug("HTML Report exported: " + path); }
public ReportExportConfiguration getReportConfiguration() { reportConfiguration.setIgnoreGraphics(Boolean.FALSE); reportConfiguration.setCollapseRowSpan(Boolean.FALSE); reportConfiguration.setDetectCellType(Boolean.TRUE); reportConfiguration.setFontSizeFixEnabled(Boolean.TRUE); reportConfiguration.setRemoveEmptySpaceBetweenColumns(Boolean.FALSE); reportConfiguration.setRemoveEmptySpaceBetweenRows(Boolean.FALSE); reportConfiguration.setIgnoreCellBorder(Boolean.FALSE); reportConfiguration.setImageBorderFixEnabled(Boolean.FALSE); reportConfiguration.setShowGridLines(Boolean.FALSE); reportConfiguration.setIgnoreCellBackground(Boolean.FALSE); reportConfiguration.setWrapText(Boolean.FALSE); reportConfiguration.setOnePagePerSheet(Boolean.TRUE); reportConfiguration.setColumnWidthRatio(1.25f); return reportConfiguration; }
/** * Export to XHTML * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toXhtml() throws JRException { HtmlExporter htmlExporter = new HtmlExporter(); htmlExporter.setExporterInput(new SimpleExporterInput(this.report)); htmlExporter.setExporterOutput(new SimpleHtmlExporterOutput(new File(getTemplatePath().replace(extensionPattern, "html")))); htmlExporter.exportReport(); return this; }
/** * Export to RTF * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toRtf() throws JRException { JRRtfExporter jrRtfExporter = new JRRtfExporter(); jrRtfExporter.setExporterInput(new SimpleExporterInput(this.report)); jrRtfExporter.setExporterOutput(new SimpleWriterExporterOutput(new File(getTemplatePath().replace(extensionPattern, "rtf")))); jrRtfExporter.exportReport(); return this; }
public static void exportReportXls(JasperPrint jp, String path) throws JRException, FileNotFoundException { SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration(); configuration.setDetectCellType(true); configuration.setWhitePageBackground(false); configuration.setIgnoreGraphics(false); configuration.setIgnorePageMargins(true); exportReportXls(jp, path, configuration); }
public ExporterOutput getExporterOutput(OutputStream output) { SimpleHtmlExporterOutput exporterOutput = new SimpleHtmlExporterOutput(output, "UTF-8"); exporterOutput.setImageHandler(new WebHtmlResourceHandler("servlets/image?image={0}")); return exporterOutput; }
private JRXlsExporter xls(JasperIXlsExporter jasperExporter) { SimpleOutputStreamExporterOutput exporterOutput = simpleOutputStreamExporterOutput(jasperExporter); SimpleXlsReportConfiguration reportExportConfiguration = new SimpleXlsReportConfiguration(); reportExcelExportConfiguration(reportExportConfiguration, jasperExporter); SimpleXlsExporterConfiguration exporterConfiguration = new SimpleXlsExporterConfiguration(); reportExcelExporterConfiguration(exporterConfiguration, jasperExporter); JRXlsExporter jrExporter = new JRXlsExporter(); jrExporter.setExporterOutput(exporterOutput); jrExporter.setConfiguration(reportExportConfiguration); jrExporter.setConfiguration(exporterConfiguration); return jrExporter; }
public ReportExportConfiguration getReportConfiguration() { float charHeight = getLinesPerPage() > 0 ? getPageHeigth() / getLinesPerPage() : 13.948f; float charWidth = getCharactersPerLine() > 0 ? getPageWidth() / getCharactersPerLine() : 7.238f; reportConfiguration.setCharHeight(charHeight); reportConfiguration.setCharWidth(charWidth); return reportConfiguration; }
private void reportExcelExporterConfiguration(AbstractXlsExporterConfiguration exporterConfiguration, JasperIExcelExporter jasperExporter) { if (jasperExporter.getCreateCustomPalette() != null) { exporterConfiguration.setCreateCustomPalette(jasperExporter.getCreateCustomPalette()); } if (jasperExporter.getWorkbookTemplate() != null) { exporterConfiguration.setWorkbookTemplate(jasperExporter.getWorkbookTemplate()); } if (jasperExporter.getKeepWorkbookTemplateSheets() != null) { exporterConfiguration.setKeepWorkbookTemplateSheets(jasperExporter.getKeepWorkbookTemplateSheets()); } }
private JRXmlExporter xml(JasperIXmlExporter jasperExporter) { SimpleXmlExporterOutput exporterOutput = simpleXmlExporterOutput(jasperExporter); if (jasperExporter.getEmbeddingImages() != null) { exporterOutput.setEmbeddingImages(jasperExporter.getEmbeddingImages()); } SimpleReportExportConfiguration reportExportConfiguration = new SimpleReportExportConfiguration(); reportExportConfiguration(reportExportConfiguration, jasperExporter); SimpleExporterConfiguration exporterConfiguration = new SimpleExporterConfiguration(); JRXmlExporter jrExporter = new JRXmlExporter(); jrExporter.setExporterOutput(exporterOutput); jrExporter.setConfiguration(reportExportConfiguration); jrExporter.setConfiguration(exporterConfiguration); return jrExporter; }
@SuppressWarnings("rawtypes") public Exporter setup() { exportConfiguration.setCompressed(Boolean.TRUE); return new JRPdfExporter(); }
/** * Export to XLS * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toXls() throws JRException { JRXlsExporter jrXlsExporter = new JRXlsExporter(); jrXlsExporter.setExporterInput(new SimpleExporterInput(this.report)); jrXlsExporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(getTemplatePath().replace(extensionPattern, "xls")))); jrXlsExporter.exportReport(); return this; }
public ExporterOutput getExporterOutput(OutputStream output) { SimpleHtmlExporterOutput exporterOutput = new SimpleHtmlExporterOutput(output, "UTF-8"); exporterOutput.setImageHandler(new WebHtmlResourceHandler("servlets/image?image={0}")); return exporterOutput; }
private SimpleOutputStreamExporterOutput simpleOutputStreamExporterOutput(JasperIExporter jasperExporter) { if (jasperExporter.getOutputStream() != null) { return new SimpleOutputStreamExporterOutput(jasperExporter.getOutputStream()); } if (jasperExporter.getOutputFile() != null) { return new SimpleOutputStreamExporterOutput(jasperExporter.getOutputFile()); } if (jasperExporter.getOutputFileName() != null) { return new SimpleOutputStreamExporterOutput(jasperExporter.getOutputFileName()); } return null; }
public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }
public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }