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();
}



}

posted @ 2013-03-06 19:40  stt_spring  阅读(182)  评论(0)    收藏  举报