• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic