• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

problem with jasperreports in html

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that the correct URL? It doesn't have any web app name in it, so it would need to be in ROOT - is it?
 
geeta gonchala
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thank you for your reply.
Actually it is generating by internal code iused iReport for designing and using directly in java.So cant modify that.
Thank you
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic