Rendering an MS Excel file in a web browser using Java without prompting
807591Mar 11 2008 — edited Mar 11 2008Hi,
I am trying to render a MS Excel file in a web browser using a Servlet. This is something like showing an excle report on clicking a button.
I have set the content type appropriately and set the Content-Disposition to 'inline'. But still i am getting the Open/Save prompt.
Is there a way in Java to directly open the excel file in the browser with out promting for Open or Save?
Here is my code,
response.setContentType("application/xls");//
response.setContentLength(baos.size());
response.setHeader(
"Content-Disposition",
"inline; filename=test.xls" );
Thanks,
LakshmiNarayanan.