How to create, modify and save Excel spread sheets in Java using Apach POI
Java doesn't have built in support for accessing excel files. Various libraries are avialable in java for this purpose. In this turoial we are using Apache PoI Api. you can download the Api from apache poi website http://poi.apache.org/download.html .The latest version is POI 3.10 . Don't forget to add these files to your build path in eclipse. Using Apache POI, you can create both Xls and Xlsx files. Prior to 2007, the format of all excel files is .xls and from 2007 the format is .xlsx . The base class that represents a excel work book in Apache POI is Workbook, for creation of .xls files the required class is HSSFWorkbook, and for .xlsx files it is XSSFWorkbook. Now lets go into the details 1. How to create .xls/.xlsx work books ? use HSSFWorkbook, XSSFWorkbook for creating xls and xlsx files respectively. Code Snippet 1 : creating xls workbook, with default settings...