• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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.
 
What are you doing in my house? Get 'em tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic