0

I have produced a jasper report in my application (JSF1.2,RichFaces 3.3.3,Portlet bridge), but I am facing a problem. The image produced by jasper is not changing dynamically even by rerendering its area. After a lot of discussions and analysis I have concluded that because the jasper provides image(new and old) with the same name... Hence the browser is not loading this image again and getting this image from the cache. I have also added the following code in the head section of the xhtml(portlet), but the result is still not changed.

<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-store"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>

Please let me know if someone has a solution for this.

Keplah
  • 954
  • 2
  • 13
  • 26
Ch Faizan Mustansar
  • 354
  • 3
  • 6
  • 18

2 Answers2

1

This is the issue with image caching with Jasper Here is the code

Just pass the random value along with image params

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?random="+Math.random()+"&image=");

user2101952
  • 45
  • 1
  • 1
  • 6
0

if the whole report is an image you can tray this hack

<img src="/yourpath/imagename.png?{put_current_time_here or some random string}" /> 
Josef Prochazka
  • 1,273
  • 2
  • 9
  • 28
  • As I didnot find any answer from this forum, I have found a workarround for this problem. i.e. I have reloaded the page and now the problem is resolved. Thanks! – Ch Faizan Mustansar Jul 31 '12 at 07:54