File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Opening excel sheet separately Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Opening excel sheet separately" Watch "Opening excel sheet separately" New topic
Author

Opening excel sheet separately

Mallikarjuna Chejerla
Greenhorn

Joined: Jul 24, 2006
Posts: 16
Can Any body tell me how to open excel sheet seperately using JSP.

Here in our application.I am generating a table in Jsp page when i click on a button i am getting a message box with button "open" and "save". When i click on 'save' it is saving the table to selected path in excel format. Now when i click on "open". it is not able to open this table in excel sheet.

When i open excel application and click on "open" button this time it is opening my table in excel sheet.

What i need is when i click on "open" button without opening MS Excel application it should open my table in a specified location with specified name. Pls tell me the code for this.

I have used the following code in my application.pls tell me the modifications or additions for this to get my requirement

response.setContentType("application/vnd.ms-excel; charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=table.xls");
response.setHeader("Content-Language","EN");
response.setHeader("Vary","Accept-Language");
response.setHeader("Cache-Control", "no-cache, post-check=0, pre-check=0");
response.setHeader("pragma", "no-cache");
response.setHeader("Cache-Control", "no-store");
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42278
    
  64
without opening MS Excel application it should open my table in a specified location with specified name.

I don't understand this. You want an Excel sheet opened without opening Excel? Or are you asking about some other application opening the XLS file?


Ping & DNS - my free Android networking tools app
Mallikarjuna Chejerla
Greenhorn

Joined: Jul 24, 2006
Posts: 16
When i click on "open" button on dialog message displayed, I want to open excel sheet automatically with data of my what JSP page contains. Now my appication is unable to do it.

When i manually opend Excel application and clicking on "open" button of dialog it is opening my JSp page in excel sheet,Otherwise it is opening excel sheet but promting an error such as 'Unable to open file'.

please Let me know the solution for this

Thanks in advance.

-Malli
Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

Sounds like one of two things
  • You're not setting the response header correctly,
  • Your machine is not set up properly for opening excel files


  • For the mime type, it should be
    application/vnd.ms-excel

    I wonder if the charset parameter is messing it up.

    Remove the lines that do not matter and see what you can find out.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Opening excel sheet separately