This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Opening xls file in html" Watch "Opening xls file in html" New topic
Author

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!


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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.

Eric
Ben Souther
Sheriff

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
 
 
subject: Opening xls file in html
 
Similar Threads
Error in excel report generation from jsp
Excel in MSIE
How to get rid of opening extra Excel window in JSP
Opening excel sheet separately
Saving an Excel Report which contains HTML tags