java生成pdf和excel的方法(五)
e());
row.createCell((short)2).setCellValue((double)stu.getAge());
cell = row.createCell((short)3);
cell.setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(stu.getBirth()));
}
//第六步,将文件存到指定位置
try {
FileOutputStream fout = new FileOutputStream("E:/students.xls");
wb.write(fout);
fout.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}