Jexcel

Java Excel API Projects

Java Excel API Project 1

Writing Spreadsheets using JExcel API
Previous Home Next

 

In this section we are going to explain the fundamentals of Jexcel API. The packages we have need to import and how we can create excel spreadsheets?

JExcel API provides jxl.jar to make excel spreadsheet using java. Through jxl.jar we can read, write or modify the excel spreadsheet .We can set borders, set properties of excel spreadsheets, set foreground color, background color etc.
 Here in this tutorial we first learn how we can write spreadsheets for this we need to import following packages.

import jxl.*; 
import jxl.write.*;

 
Then we need to create the writable workbook object by using the factory method on the Workbook class.

The next step is creating sheets for the workbook.

Now add the cells into the worksheet and formatting cell, set borders, properties of spreadsheet, add images, add charts etc.
Once we have finished above. 

Then at last call write () on the workbook to write on file and finally call close () method to close the workbook .If we forget write () then file will completely empty.

 

Previous Home Next