code: protected void writeItem(Object datas) {
      HSSFRow row = sheet.createRow(index); // 建立新行
      if (datas != null) {
        if (datas.getClass().isArray()) {
          Object[] values = (Object[]) datas;
          for (int i = 0; i < values.length; i++) {
            HSSFCell cell = row.createCell(i);
            if (values[i] instanceof Number) {
              cell.setCellType(CellType.NUMERIC);
              cell.setCellValue(((Number) values[i]).doubleValue());
            } else if (values[i] instanceof java.sql.Date) {
              cell.setCellValue((Date) values[i]);
              cell.setCellStyle(getDateStyle());
            } else if (values[i] instanceof java.util.Date) {
              cell.setCellValue((Date) values[i]);
              cell.setCellStyle(getTimeStyle());
            } else if (values[i] instanceof Calendar) {
              cell.setCellValue((Calendar) values[i]);
              cell.setCellStyle(getTimeStyle());
            } else {
              cell.setCellValue(new HSSFRichTextString((values[i] == null) ? "" : values[i].toString()));
            }
          }
        } else {
          HSSFCell cell = row.createCell(0);
          if (datas instanceof Number) {
            cell.setCellType(CellType.NUMERIC);
          }
          cell.setCellValue(new HSSFRichTextString(datas.toString()));
        }
      }
    }
docs: <p>
  writeItem.
  </p>
  
  @param datas a {@link java.lang.Object} object.