String fileName = "C:\\统计数据"+startDate2+"-"+endDate2+".xls";
WritableWorkbook workbook =Workbook.createWorkbook(new File(fileName));
2、创建数据样式:
//字体:
//字体大小,字体类型。
WritableFont wr = newWritableFont(WritableFont.TIMES,14,WritableFont.BOLD);
//创建字体样式引用
WritableCellFormat fontFormat1 = new WritableCellFormat(wr);
//对其方式
fontFormat1.setAlignment(jxl.format.Alignment.CENTRE);
//是否有边框
fontFormat1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
//时间:
jxl.write.DateFormat df = newjxl.write.DateFormat("yyyy-MM-dd");
WritableCellFormat dateFormat = new WritableCellFormat(df);
dateFormat.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
dateFormat.setAlignment(jxl.format.Alignment.CENTRE);</