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 xls fine in web Browser using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "opening xls fine in web Browser using jsp" Watch "opening xls fine in web Browser using jsp" New topic
Author

opening xls fine in web Browser using jsp

Ahmed Shaikh
Ranch Hand

Joined: Jul 25, 2005
Posts: 51
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

Joined: Dec 11, 2004
Posts: 13410

Ahmed,
"plzzzzzzzzzz" is not a word.

This might help you:
http://faq.javaranch.com/view?JspAndExcel


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ahmed Shaikh
Ranch Hand

Joined: Jul 25, 2005
Posts: 51
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Jul 25, 2005
Posts: 51
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 11, 2004
Posts: 13410

Here is a link to the other thread I mentioned:
http://www.coderanch.com/t/288419/JSP/java/Open-CSV-file-Excel-not
Ahmed Shaikh
Ranch Hand

Joined: Jul 25, 2005
Posts: 51
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

Joined: Mar 22, 2000
Posts: 12671
    
    5
For manipulating the contents of an excel file in Java, take a look at the Apache POI project.
Bill


Java Resources at www.wbrogden.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: opening xls fine in web Browser using jsp
 
Similar Threads
URL redirection Program not working.
jsp connectivity with Crystal report 9
Netbeans Vs Eclipse for JSP and JSTL
Problem in running a web application in IE6
Incompatible magic value