Search in sources :

Example 1 with TDate

use of cn.cerc.jdb.core.TDate in project summer-bean by cn-cerc.

the class Template method writeColumn.

protected void writeColumn(WritableSheet sheet, int col, int row, Column column) throws WriteException, RowsExceededException {
    if (column instanceof NumberColumn) {
        jxl.write.Number item = new jxl.write.Number(col, row, (double) column.getValue());
        sheet.addCell(item);
    } else if (column instanceof DateColumn) {
        TDate day = (TDate) column.getValue();
        DateTime item = new DateTime(col, row, day.getData(), new WritableCellFormat(df1));
        sheet.addCell(item);
    } else if (column instanceof DateTimeColumn) {
        DateTime item = new DateTime(col, row, (Date) column.getValue(), new WritableCellFormat(df2));
        sheet.addCell(item);
    } else {
        Label item = new Label(col, row, column.getValue().toString());
        sheet.addCell(item);
    }
}
Also used : TDate(cn.cerc.jdb.core.TDate) Label(jxl.write.Label) WritableCellFormat(jxl.write.WritableCellFormat) DateTime(jxl.write.DateTime)

Example 2 with TDate

use of cn.cerc.jdb.core.TDate in project summer-mis by cn-cerc.

the class AbstractField method getDate.

public TDate getDate() {
    String val = this.getString();
    if (val == null)
        return null;
    TDateTime obj = TDateTime.fromDate(val);
    if (obj == null)
        return null;
    return new TDate(obj.getData());
}
Also used : TDate(cn.cerc.jdb.core.TDate) TDateTime(cn.cerc.jdb.core.TDateTime)

Aggregations

TDate (cn.cerc.jdb.core.TDate)2 TDateTime (cn.cerc.jdb.core.TDateTime)1 DateTime (jxl.write.DateTime)1 Label (jxl.write.Label)1 WritableCellFormat (jxl.write.WritableCellFormat)1