Hello,
I have read the Webapp example in demo samples of JasperReport but still could not solve the problem.
I am displaying a simple HTML report on the fly using
servlet and it is not getting displayed in proper format. When I run this without using servlet and export it as HTML file, I observed it creates an image in a directory called reportname.html_files/px (and my guess is that this image is not getting displayed when I generate HTML on the fly) I am using the code given below to display the HTML on the fly and any image it is using. Can somebody please help me in figuring out as why this is not working?? Any help is appreciated.
jPrint = JasperFillManager.fillReport(compiledInputStream, parameters, datasource);
response.setContentType("text/html");
PrintWriter out = response.getWriter();
JRExporter exporter = new JRHtmlExporter();
Map imagesMap = new HashMap();
request.getSession().setAttribute("IMAGES_MAP", imagesMap);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image=");
exporter.exportReport();
Thanks