Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening excel sheet separately

 
Mallikarjuna Chejerla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mallikarjuna Chejerla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic