ketro Posted December 7, 2009 Share Posted December 7, 2009 How can I export my Xls report to a (binary) string instead of file?JExcelApiExporter XlsExporter = new JExcelApiExporter();XlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, printedReport);XlsExporter.setParameter(JRXlsAbstractExporterParameter.IS_DETECT_CELL_TYPE, new Boolean("true"));XlsExporter.exportReport();String Xls=""; Just like I do with PDF's:JasperExportManager.exportReportToPdf(printedReport) ---Thank you! Link to comment Share on other sites More sharing options...
lucianc Posted December 14, 2009 Share Posted December 14, 2009 Quoting the JasperExportManager.exportReportToPdf(JasperPrint jasperPrint) method, see below (btw, JasperReports is open source).You can do the same thing with JExcelApiExporter.HTH,LucianCode:ByteArrayOutputStream baos = new ByteArrayOutputStream();JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.exportReport(); return baos.toByteArray(); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now