Workaround for downloads in IE8

This may save some time to people: I have not had time to investigate further, but it seems that IE8 has broken downloading even more than previous versions of IE. In the current release of IE8, setting cache time to 0 breaks even normal downloading (I suspect for a similar reason). My workaround is to set the cache time to some small value (5 secs worked for me). I suspect AbstractApplicationServlet will have to be special-cased for this – I am pretty sure that the current code does not work with InternetExploder over https (which requires different headers – no-cache does not work with IE over HTTPS).

		StreamResource streamResource = new StreamResource(streamSource, filename+".xls", this);
		streamResource.setCacheTime(5000); // no cache (<=0) does not work with IE8
		streamResource.setMIMEType("application/x-msexcel"); 
		this.getMainWindow().open(streamResource,"_new");

Hello Jean-Francois,

i am using JasperReports in combination with iReport to design/generate .pdf and .xls files out of a Vaadin-based application.
I show the results in the same way you did it in your coding.

This works fine all the time using IE 7.

With IE 8 and all the suggested solutions with the IE8 settings, it work’s no more.

For example:

The user changes values in a table, which i persist in a database ( both database and screen are showing the changes ). By clicking on the export or print menue functionality, the new browser window still shows the old values…Shi…!

Can you help me out with your experiences ?

Thanks a lot for your help.

Hans

Hello Jean-Francois,

unbelievable, i kicked myself.

Used a property file for the database connection. When sending the source code to diffrent development machines i used a fixed computer name instead of localhost for the oracle db connection.

In the online application i am using Oracle TopLink for the persistance, for the export i am using a standard jdbc connection ( which is using the property file )…and here it happens.

So the warning: Keep the code clean !

Everything is working fine now.

Thank you

Hans