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.
Programmatically Manipulating Microsoft Excel Spreadsheets with the Apache POI API (Page 1 of 4 )
The Apache POI contains a number of components. In this article, we’ll be focusing our study on the HSSF component. The HSSF project will provide us with the ability to read and write from XLS spreadsheets.
Gathering What You Need
As stated earlier, we’ll be using the Apache POI API to manipulate a spreadsheet. You can download that spreadsheet here (sales.xls). You also need to download the Apache POI jar files. These are available at http://www.apache.org/dyn/closer.cgi/jakarta/poi/. At the time of this article’s writing, the Apache POI was in version 1.5.1.