package com.Aflame.Excel;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class CreateCell {
/**
* @param args
* @author Aflame
* 利用poi生成一个Excel
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
HSSFWorkbook wb = new HSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("d:/io/workbook.xls");
HSSFSheet sheet = wb.createSheet("first");
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell((short)0);
cell.setCellValue("This is the first sheet!");
wb.write(fileOut);
fileOut.close();
}
}