• 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

Thanks in advance

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am using jasper reports for generating reports.I am trying to export in html format with in browser.I am getting report but i'm getting unnecccesary images in that page.and also i'm not able to display neccesary images also.can you help me.

Here this is my code i'm using
File reportFile = new File("E:/workspace/PrivoLock27july/resources/Sample.jasper");

JasperReport jasperReport =
(JasperReport)JRLoader.loadObject(reportFile.getPath());
JasperPrint jasperPrint =
JasperManager.fillReport(jasperReport,map,jdbcConnection);
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);
Map imagesMap=new HashMap();
request.getSession().setAttribute("IMAGES_MAP",imagesMap);

htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP,imagesMap);

htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image=");
htmlExporter.exportReport();

Thanks in advance.
 
reply
    Bookmark Topic Watch Topic
  • New Topic