【文件属性】:
文件名称:jxl Java导出Excel文件jar 包
文件大小:974KB
文件格式:RAR
更新时间:2013-04-15 11:29:05
jxl java Excel 导出
HttpSession session = request.getSession();
//读取学生集合
List students = (List) session
.getAttribute("students");
//读取学生编号集合
List stuid =(List )session.getAttribute("stuid");
//读取学生成绩集合
List stuScore = (List) session.getAttribute("stuScore");
int i = 0;
int j = 0;
int k = 0;
for(Student stu:students){
i++;
String stuu = request.getParameter(stu.getName());
//创建Label对象
Label lableA = new Label(0,i,stuu);
ws.addCell(lableA);
}
for(String stuidd:stuid){
j++;
String stuids = stuidd.trim();
Label labelB = new Label(1,j,stuids);
ws.addCell(labelB);
}
for(String score:stuScore){
k++;
String sco =score.trim();
Label labelC = new Label(2,k,sco);
ws.addCell(labelC);
}
wwb.write();
wwb.close();
} catch (Exception e) {
System.out.println( "出错了!!!" + e);
}
【文件预览】:
jxl
----jxl()
--------jxl-2.6.6.jar(704KB)
--------jxl.jar(383KB)