2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: qecmu - qecmu image missing in xml 2003-10-01 14:26 Hello. I'm using jasperreports 0.5.0 with java 1.4.1 on Windows XP. I use IE 6.0.28 to display reports. I export to a xls byte array using JRXmlExporter. Here is the code: -------------------------------------------------- public static byte[] exportReportToXls(JasperPrint jasperPrint) throws JRException { JRXlsExporter exporter = new JRXlsExporter(); ByteArrayOutputStream xlsReport = new ByteArrayOutputStream(); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, new HashMap()); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport); exporter.exportReport(); return(xlsReport.toByteArray()); } -------------------------------------------------- After that, I use this function in a servlet to display the report on screen: -------------------------------------------------- pdf = exportReportToXls(jasperPrint); response.setContentType("application/vnd.ms-excel"); response.setHeader("Expires", ""); //-IE- response.setHeader("Cache-Control", "");//-IE- response.setHeader("Pragma", "");//-IE- response.setContentLength(pdf.length); response.getOutputStream().write(pdf); response.getOutputStream().flush(); response.getOutputStream().close(); -------------------------------------------------- The report display images passed by parameters. There is no problem in html or pdf, but the xml result not display any images. What's the problem? By: qecmu - qecmu RE: image missing in XLS 2003-10-01 14:27 Sorry, wrong title. Is in XLS format By: Teodor Danciu - teodord RE: image missing in XLS 2003-10-03 14:06 Hi, The POI library that we use to generate XLS content simply does not support images. Thank you, Teodor 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