public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }
public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }
public ExporterOutput getExporterOutput(OutputStream output) { return new SimpleWriterExporterOutput(output); }
/** * Export to TXT * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toText() throws JRException { JRTextExporter jrTextExporter = new JRTextExporter(); jrTextExporter.setExporterInput(new SimpleExporterInput(this.report)); jrTextExporter.setExporterOutput(new SimpleWriterExporterOutput(new File(getTemplatePath().replace(extensionPattern, "txt")))); jrTextExporter.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; }
/** * Export to CSV * * @return SpecificTemplateExporterBuilderService * @throws JRException JRException exception */ public SpecificTemplateExporterBuilderService toCsv() throws JRException { JRCsvExporter jasperCsvExporter = new JRCsvExporter(); jasperCsvExporter.setExporterInput(new SimpleExporterInput(this.report)); jasperCsvExporter.setExporterOutput(new SimpleWriterExporterOutput(new File(getTemplatePath().replace(extensionPattern, "csv")))); jasperCsvExporter.exportReport(); return this; }
private SimpleWriterExporterOutput simpleWriterExporterOutput(JasperIExporter jasperExporter) { if (jasperExporter.getOutputWriter() != null) { return new SimpleWriterExporterOutput(jasperExporter.getOutputWriter()); } if (jasperExporter.getOutputStream() != null) { if (jasperExporter.getCharacterEncoding() != null) { return new SimpleWriterExporterOutput(jasperExporter.getOutputStream(), jasperExporter.getCharacterEncoding()); } else { return new SimpleWriterExporterOutput(jasperExporter.getOutputStream()); } } if (jasperExporter.getOutputFile() != null) { if (jasperExporter.getCharacterEncoding() != null) { return new SimpleWriterExporterOutput(jasperExporter.getOutputFile(), jasperExporter.getCharacterEncoding()); } else { return new SimpleWriterExporterOutput(jasperExporter.getOutputFile()); } } if (jasperExporter.getOutputFileName() != null) { if (jasperExporter.getCharacterEncoding() != null) { return new SimpleWriterExporterOutput(jasperExporter.getOutputFileName(), jasperExporter.getCharacterEncoding()); } else { return new SimpleWriterExporterOutput(jasperExporter.getOutputFileName()); } } return null; }
? new SimpleWriterExporterOutput(destinationFileName) : new SimpleOutputStreamExporterOutput(destinationFileName);
} else if (ReportOutputType.csv == outputType){ exporter = new JRCsvExporter(); exporter.setExporterOutput(new SimpleWriterExporterOutput(outputStream)); SimpleCsvExporterConfiguration config = new SimpleCsvExporterConfiguration(); config.setFieldDelimiter(CSV_DELIMETER); } else if (ReportOutputType.doc == outputType ){ exporter = new JRRtfExporter(); exporter.setExporterOutput(new SimpleWriterExporterOutput(outputStream)); exporter.setConfiguration(new SimpleRtfExporterConfiguration()); } else if (ReportOutputType.docx == outputType){
} else if (ReportOutputType.csv == outputType){ exporter = new JRCsvExporter(); exporter.setExporterOutput(new SimpleWriterExporterOutput(outputStream)); SimpleCsvExporterConfiguration config = new SimpleCsvExporterConfiguration(); config.setFieldDelimiter(CSV_DELIMETER); } else if (ReportOutputType.doc == outputType ){ exporter = new JRRtfExporter(); exporter.setExporterOutput(new SimpleWriterExporterOutput(outputStream)); exporter.setConfiguration(new SimpleRtfExporterConfiguration()); } else if (ReportOutputType.docx == outputType){