Thursday, September 8, 2011

Apache POI - The Java API to create Microsoft Office Documents

Apache POI is the Java API created to access Microsoft format documents using Java.

For example you can write data to an excel sheet using POI.

To write to an excel sheet first you need to create HSSFWorkbook object. This represents a Work Book in excel. Then you can create number of work sheets in this work book.

One a sheet is created you can get the rows in it one by one. These rows consist of cells. The data you need to write in the excel sheet should go inside these cells by providing them as the cell value. Further, these cells can be formatted to have different types of data inside them, such as numeric type, formula type, etc.





No comments: