tags:

views:

1089

answers:

4

I wanted to write a program where an Excel sheet is imported onto a webpage. Also the look and feel of the webpage should be the same as that of the Excel sheet. The whole excel sheet should be displayed on the webpage.

Is there any package for Java where we can import the Excel sheet and print its data and its sheet onto the webpage?

+2  A: 

I've used POI in the past for reading and writing MS Excel docs it worked pretty well: http://poi.apache.org/

So you would need to write some code to upload the file, parse it with POI, then you could output it with this: http://www.activewidgets.com/grid/

mmorrisson
Is it necessary to use POI library, can't i import the complete excel sheet onto website.. Hope you understand my meaning..
AGeek
Something needs to convert from the binary format of Excel to HTML/Javascript to be viewable on a webpage. You could just serve the XLS file with a content-type header of application/vnd.ms-excel. This will launch an application to view the Excel file, and you will no longer be in your web browser.
mmorrisson
A: 

I asked a friend and he told me he used that and it worked nice, had it here on my favorites.

About the displaying: Well, that pretty much depends on the layout/design you want, but I guess you can just show it using tables, that's what they are designed for.


Edit:

I removed the link as I noticed it was an outdated API and it also wasn't what you really wanted. Though the link pointed in another question here --> http://poi.apache.org/ seems really nice for what you want

fmsf
+4  A: 

You might try ZK Spreadsheet. Google for it. The site wouldn't let me post the URL.

http://www.zkoss.org/smalltalks/zssalpha/index.dsp
Jon
I think u need some rep before you can post links. probably a way to avoid spam
fmsf
A: 

Apache POI is the right thing here as long as reading the spreadsheet is concerned. We have used it in the past to read/write Excel documents. Of course there are some shortcomings where complex Excel documents are concerned.

Regarding display of the Excel document, do you want any sort of interaction with the sheet on the webpage. If not, you can convert the excel sheet to PDF/HTML and display the same. You can use the OpenOffice API's for achieving this conversion.

Edit : Just checked out ZKSpreadsheet too ... Cool

gnlogic