Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

opening xls fine in web Browser using jsp

 
Ahmed Shaikh
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Please any one tell me, that is there any way to open excel fine in web browser using jsp. If yes then plzzzzzzzzzzzzzzz provide me some referance using example and document.

plzzzz help.

Thanx in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed,
"plzzzzzzzzzz" is not a word.

This might help you:
http://faq.javaranch.com/view?JspAndExcel
 
Ahmed Shaikh
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,
I tryed it...but unable to do it.
Please provide me a example to open Excel file in browser after clicking a link on a browser.
This Excel will open in same browser or may be in other brower,my application need a to open excel fine in browser.

Help me in solving it.

Thanx in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you working with pre-existing Excel files (.xls), that are already on your server or are you trying to display the results of a database query in Excel?
 
Ahmed Shaikh
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Ben I am working with pre existing .xls file.
For example:- There is a .xls file on my web server and when I click a link on webBrowser then that .xls should be display on my browser.I just want to display that pre-existing Excel file (which is there on wesServer hard drive)in my webBrowser after clicking a link in webbrowser.
Suppose there a file name Laterel.xls on hard drive when a user click a link in browser then this file(Literel.xls) should be dispaly in browser.
--------------
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you stream the file yourself (with a servlet) you can set whatever headers (Content-Type, Content-Disposition, ... ) you like.
There was a recent thread in this or the servlet's forum that covered this, exact same issue.

If you want an example of a streaming servlet, go to:
http://simple.souther.us
and look for SimpleStream.

In the example, I'm streaming image files from a directory under WEB-INF but the code would be the same for Excel, PDF, or any other type of binary file.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ahmed Shaikh
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben thanx a lot for your help.
Still I need some help from you.
Now I am able to open excel file in browser...further I need some help to optimised it.
Now in that excel file I wan't to make some changes or I have to enter new values and that new entered value should be display in jsp file(browser).

Help me Ben.
Thanx in advance
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For manipulating the contents of an excel file in Java, take a look at the Apache POI project.
Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that you want to be able to edit an Excel sheet residing on a server?
There is nothing in JSP for doing this.
You would either need to save the Excel sheet to the local machine, then edit it and then upload it back to the server

or set up something that works over the Webdav protocol like Jakarta/Slide (which is way beyond the scope of a JSP forum),

or use a product like the jakarata/poi product which operates on MS Office files from Java objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic