Hi friends,
I am trying to display image in html format using jasper reports.image not displaying in the report.In the browser i'm getting
http://localhost:8080/image?image=img_0_0_4 Not available.
here is my code
PrintWriter printWriter = response.getWriter();
JRHtmlExporter htmlExporter = new JRHtmlExporter();
response.setContentType("text/html");
request.getSession().setAttribute(
ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,
jasperPrint);
htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT,
jasperPrint);
htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER,
printWriter);
htmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,
Boolean.FALSE);
Map imagesMap = new HashMap();
request.getSession().setAttribute("IMAGES_MAP", imagesMap);
htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP,
imagesMap);
htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,
request.getContextPath()
+ "image?image=/images/japser/Sample.html_files/");
htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image=");
htmlExporter.setParameter(
JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,
Boolean.FALSE);
htmlExporter.setParameter(
JRHtmlExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
Boolean.FALSE);
htmlExporter.setParameter(JRHtmlExporterParameter.SIZE_UNIT, "px");
htmlExporter.exportReport();
htmlExporter.exportReport();
can any body help me.whats the problem with this code.
Thanks in advance
geeta.