my dog learned polymorphism*
The moose likes Applets and the fly likes reading and displaying excel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "reading and displaying excel file" Watch "reading and displaying excel file" New topic

reading and displaying excel file

Laura Williamson
Ranch Hand

Joined: Apr 28, 2004
Posts: 44
Hi - I have a simple applet that reads in from a text file and displays the values to the screen. Has anyone done this, but reading in from Excel file instead? Thanks
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41052
I assume the file is on the server where the applet resides, and not on the client machine?

The Apache POI library can read Excel files. You would create an HSSFWorkbook object from the file input stream, and then use the getSheet method to obtain a reference to the sheet you want to display. The sheet's getRow method gives you a reference to a row of cells, from which you can call getCell to get the contents of any particular cell.

Ping & DNS - my free Android networking tools app
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Hi Ulf,

What about the powerpoint files.... Can we read them as well??

Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41052
The POI library has limited support for PPT files as well (not nearly as good as the XLS support). Here's an introduction to what's possible.
subject: reading and displaying excel file
Similar Threads
Excel file manipulation
Amending a string value with Performance and Efficency in mind
opening excel application in browser
CSV+truncate leading zero solution
Java - MsExcel - java