private void createDateSheet(WritableWorkbook workBook)
throws RowsExceededException, WriteException, ApplicationException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cd = Calendar.getInstance();
int year = cd.get(Calendar.YEAR);
int mouth = cd.get(Calendar.MONTH);
cd.set(year, mouth + 1, 0);
int end = cd.get(Calendar.DAY_OF_MONTH);
WritableSheet workSheet = null;
jxl.write.Label lbl;
workSheet = workBook.getSheet("persontype");
lbl = new jxl.write.Label(1, 0, "Date");
workSheet.addCell(lbl);
for (int i = 1; i <= end; i++) {
cd.set(year, mouth, i);
lbl = new jxl.write.Label(1, i, sdf.format(cd.getTime()));
workSheet.addCell(lbl);
}
}
throws RowsExceededException, WriteException, ApplicationException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cd = Calendar.getInstance();
int year = cd.get(Calendar.YEAR);
int mouth = cd.get(Calendar.MONTH);
cd.set(year, mouth + 1, 0);
int end = cd.get(Calendar.DAY_OF_MONTH);
WritableSheet workSheet = null;
jxl.write.Label lbl;
workSheet = workBook.getSheet("persontype");
lbl = new jxl.write.Label(1, 0, "Date");
workSheet.addCell(lbl);
for (int i = 1; i <= end; i++) {
cd.set(year, mouth, i);
lbl = new jxl.write.Label(1, i, sdf.format(cd.getTime()));
workSheet.addCell(lbl);
}
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25086534/viewspace-683300/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25086534/viewspace-683300/