• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading and displaying excel file  RSS feed

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

What about the powerpoint files.... Can we read them as well??
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!