Wednesday, January 13, 2010

How to remove null images of html type reports ? (Jasperreports)

if you are wish to generate the html type reports using jasper-reports you have to define the ImageServlet in
the web.xml
<servlet>  
   <servlet-name>ImageServlet</servlet-name>  
   <servlet-class>net.sf.jasperreport.j2ee.  
   servlets.ImageServlet</servlet-class>  
   <url-pattern>/servlets/images</url-pattern>  
</servlet>
Then you want to set the "JRHtmlExporterParameter.IMAGES_URI" parameter in your program .
JRHtmlExporter jrHtmlExporter = new JRHtmlExporter();  
 jrHtmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"../servlets/image?image=");