可以先判断单元格的类型,有的日期是字符串存储的,有的是按日期存储的(单元格按数字解析),代码如下: Cell cell = row.getCell(); Date date = null; if (cell.getCellType() == CellType.STRING){ //按字符串转换日期 } else if (cell.getCellType() == CellType.NUMERIC) { date = cell.getDateCellValue(); }
FORM set_style USING fieldname style TYPE string CHANGING it_styles TYPE lvc_t_styl. DATA: ls_style TYPE lvc_s_styl. CLEAR ls_style. ls_style-fieldname = fieldname. IF style EQ 'ENABLE'. ls_style-s