、protected HttpServletResponse getResponse() {
return ServletActionContext.getResponse();
}
/**
* 输出表头
* @return
*/
public void CraeateExce(String []select,String[] stitle,WritableSheet sheet){
try {
Label label2;
for(int i=0;i<select.length;i++){
label2 = new Label(i,0,select[i],getSelectCellFormat());
sheet.addCell(label2);
}
for(int i=0;i<stitle.length;i++){
// Label(x,y,z)其中x代表单元格的第x+1列,第y+1行, 单元格的内容是y
// 在Label对象的子对象中指明单元格的位置和内容
byte[] countLength = stitle[i].getBytes();
sheet.setColumnView(i, countLength.length + 5);//设置行的宽度
// sheet.setRowView(i, 300);//设置行的高度
label2 = new Label(i,1,stitle[i],getTitleCellFormat());
// 将定义好的单元格添加到工作表中
sheet.addCell(label2);
}
} catch (Exception e) {
System.out.println("---出现异常---");
e.printStackTrace();
}
}
return ServletActionContext.getResponse();
}
/**
* 输出表头
* @return
*/
public void CraeateExce(String []select,String[] stitle,WritableSheet sheet){
try {
Label label2;
for(int i=0;i<select.length;i++){
label2 = new Label(i,0,select[i],getSelectCellFormat());
sheet.addCell(label2);
}
for(int i=0;i<stitle.length;i++){
// Label(x,y,z)其中x代表单元格的第x+1列,第y+1行, 单元格的内容是y
// 在Label对象的子对象中指明单元格的位置和内容
byte[] countLength = stitle[i].getBytes();
sheet.setColumnView(i, countLength.length + 5);//设置行的宽度
// sheet.setRowView(i, 300);//设置行的高度
label2 = new Label(i,1,stitle[i],getTitleCellFormat());
// 将定义好的单元格添加到工作表中
sheet.addCell(label2);
}
} catch (Exception e) {
System.out.println("---出现异常---");
e.printStackTrace();
}
}
308

被折叠的 条评论
为什么被折叠?



