Home arrow Apache arrow Page 3 - Programmatically Manipulating Microsoft Excel Spreadsheets with the Apache POI API
APACHE

Programmatically Manipulating Microsoft Excel Spreadsheets with the Apache POI API


The Apache Jakarta POI project consists of Java APIs dedicated to the manipulation of files based on Microsoftís OLE 2 Compound Document format. In this article, youíll learn how to use the APIs of the POI project to read from and write to Microsoft Excel spreadsheets. As you will see, the programmatic liberty to manipulate Excel files represents a powerful offering to the Java programmer.

Author Info:
By: Kulvir S. Bhogal
Rating: 4 stars4 stars4 stars4 stars4 stars / 65
November 26, 2003
TABLE OF CONTENTS:
  1. · Programmatically Manipulating Microsoft Excel Spreadsheets with the Apache POI API
  2. · Letís Learn How to Write to a Spreadsheet
  3. · Letís Learn How to Read From a Spreadsheet
  4. · Conclusion

print this article
SEARCH DEVARTICLES

Programmatically Manipulating Microsoft Excel Spreadsheets with the Apache POI API - Letís Learn How to Read From a Spreadsheet
(Page 3 of 4 )

While the Apache POI allows us to write to spreadsheets, it also allows us to read from them. In the code shown in Listing 2, we do just that, reading off the values of our states and their corresponding sales figures and directing them to the system console. Youíll notice how much of our code is similar to that of Listing 1. We again open our spreadsheet, which we specify is located at c:articlessales.xls. HSSFCell and HSSFRow objects are used to narrow and house the cells we want to read data from. We then use the getStringCellValue and getNumericCellValue methods to extract the cell data and display it to the console.


blog comments powered by Disqus
APACHE ARTICLES

- Programmatically Manipulating Microsoft Exce...
- Installing PHP under Windows
- Compressing Web Content with mod_gzip and mo...
- Compressing Web Output Using mod_deflate and...
- Setting Up Apache 2.0.45 to Parse PHP Pages
- Custom Error 404 Documents with PHP
- Using Apache and PHP on Mac OS X
- ASP: Active Sessions, Active Logins and Tota...
- Working With Oracle on Windows: Part 1
- The Quick-n-Dirty Guide to Setting Up Apache...
- Installing Apache With SSL: The Complete Gui...
- 7 Powerful .htaccess Customization Tips
- Trap And Get Notified: A Practical Solution ...
- One Way To Use Server Side Includes
- Using ForceType For Nicer Page URLs

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials