nullpx image issue in Jasper HTML report

report

I was creating a HTML Jasper Report. It was working fine, but I saw many failed images. When I see the source, I found many image tags like the following.

<img alt="" src="nullpx" style="width: 20px; height: 24px;"/>

When I googled, I found an image property need to be set to give the proper image name.

JRExporter exporter = new JRHtmlExporter();
...
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,printWriter);
...
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image=");
....
exporter.exportReport();

I need to search whether we can avoid it. anyway this is a temporary solution. I created a servlet to create transparent empty GIF and called it over here.

Advertisements