Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
JavaRanch » Java Forums » Java » Applets
Bookmark "reading and displaying excel file" Watch "reading and displaying excel file" New topic
Author

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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading and displaying excel file
 
It's not a secret anymore!