Jump to content

Images and Charts in HTML


divsen

Recommended Posts

Hi

 

I am using Jasper Reports to create my reports..everything is fine with PDF..the problem is with HTML..the images and Charts does'nt show up...i used isLazy property and the images are appearing..but my chart is'nt...

 

i saw the webapp sample and included ImageServlet in my web.xml..but that din help...

 

here is the code i use for HTML..

 

FacesContext faces = FacesContext.getCurrentInstance();

HttpServletResponse response = (HttpServletResponse) faces

.getExternalContext().getResponse();

HttpServletRequest request = (HttpServletRequest) faces.getExternalContext().getRequest();

response.setContentType("text/html");

 

response.setHeader("Cache-Control", "cache, must-revalidate");

response.setHeader("Pragma", "public");

ServletOutputStream outputStream = response.getOutputStream();

request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);

JRHtmlExporter htmlExporter = new JRHtmlExporter();

htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

htmlExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);

htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "/servlets/images?image=");

htmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);

 

htmlExporter.exportReport();

 

outputStream.flush();

outputStream.close();

faces.responseComplete();

 

 

can anybody plz help me...

Post edited by: divsen, at: 2006/09/13 20:59

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...