Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading and displaying excel file

 
Laura Williamson
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
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
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.
 
Sandeep Chhabra
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
Pie
Posts: 42967
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic