File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Opening xls file in html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Opening xls file in html" Watch "Opening xls file in html" New topic

Opening xls file in html

Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
How do I open excel file in browser? On click of link I need to open the excel file alone separately. But xls file is opening in browser window.

It opens in new window but it has all browser status bar etc.. on top..It is embedded within browser. Cannot I open without embedding it in browser window? Thanks in advance!

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
The browser will open files if it knows how to do it. There is no way to specify that it should be opened up in Excel.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you control how the file is streamed to the browser, you can set the Context-Disposition header with "attachment" instead of the "inline" header.

There is some example JSP code that does this in the JSP FAQ, see JspAndExcel.
[ April 10, 2007: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Opening xls file in html
It's not a secret anymore!