• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Opening excel sheet separately

 
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");
 
Rancher
Posts: 43016
76
  • 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
 
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.
     
    When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic