2006 IR Open Dicussion Posted August 26, 2006 Share Posted August 26, 2006 By: Stefano Maxis - stefano_maxis getting bytes  2006-01-12 06:48 Does anyone know how to get bytes from an html created with jasperreport without writing the file?ÂI mean, there is "JasperRunManager.runReportToPdf(jasperReport, new HashMap(), getConnection());" or "JasperExportManager.exportReportToPdf(jasperPrint);" for pdf and i need the same for html, but i don't know which method i can use (if it exist).ÂÂthanks ÂStefano By: Sanjeev - point1by0 RE: getting bytes  2006-01-12 07:22 Hi, ÂÂYou could use JRHtmlExporter as: ÂÂJRExporter exporter = new JRHtmlExporter(); ÂByteArrayOutputStream baos = new ByteArrayOutputStream(); Âbyte[] bytes = null; ÂÂ// Set the Jasper print obj. to export Âexporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); Â// Set the output stream to export to Âexporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); Â// Set additional parameters if required ÂÂexporter.exportReport(); Âbytes = baos.toByteArray(); ÂÂHope this helps, Â-Sanjeev By: Thomas Ludwig Kast - tomkast RE: getting bytes  2006-01-12 09:19 have a look at:ÂÂjasperreportsdemosampleswebappWEB-INFclassesservletsPdfServlet.java 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