shared items

Friday, September 5, 2008

Excel File manipulation

// close out workbooks
WritableWorkbook wb = out.getWorkbook();
// Write meta data in second sheet, i.e. sheet 1
WritableSheet ws = wb.getSheet(1);
WritableSheet ws0 = wb.getSheet(0);

/ bordFmt.setBorder(Border.ALL, BorderLineStyle.THICK);
WritableCellFormat dtFmt = new WritableCellFormat(bold ,new DateFormat("MM/dd/yyyy"));

ws.addCell(new Label(0,0,"Date", boldFmt));
// Get the current date and time from the Calendar object
Date now = Calendar.getInstance().getTime();
dtFmt.setBorder(Border.ALL, BorderLineStyle.THIN);
WritableCellFormat dateFormat = new WritableCellFormat (dtFmt);
DateTime dateCell = new DateTime(1, 0, now, dateFormat);

// remove second sheet that contains meta data.

No comments: