POI

public class Poi {


public static void main(String[] args) {
HSSFWorkbook workbook=new HSSFWorkbook();
HSSFSheet sheet=workbook.createSheet();
HSSFRow row=sheet.createRow(0);
HSSFCell cell00=row.createCell(0);
HSSFCell cell01=row.createCell(1);
cell00.setCellValue("学生姓名");
cell01.setCellValue("学生编号");

HSSFCell cell10=row.createCell(0);
HSSFCell cell11=row.createCell(1);
cell10.setCellValue("张三");
cell11.setCellValue("2013");
FileOutputStream fos=null;
try {
fos=new FileOutputStream("d:/007/a.xls");

workbook.write(fos);


} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



}

原文地址:https://www.cnblogs.com/stting/p/POI.html