Пример #1
0
  private void processRow(Row row) {
    int fc = row.getFirstCellNum();
    if (fc == 0) {
      Cell cell = row.getCell(0);
      if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
        columnCount = columnCount < row.getLastCellNum() ? row.getLastCellNum() : columnCount;

        String rowType = cell.getStringCellValue().toUpperCase();
        switch (rowType) {
          case "TITLE":
            {
              title.add(row);
            }
            break;
          case "GROUPH":
            {
              String fName = getGroupParam(row);
              if (!fName.isEmpty()) {
                detail.addGroup(true, row, fName);
              }
            }
            break;
          case "DETAIL1":
            {
              detail.add(row);
            }
            break;
          case "GROUPF":
            {
              String fName = getGroupParam(row);
              if (!fName.isEmpty()) {
                detail.addGroup(false, row, fName);
              }
            }
            break;
          case "SUMMARY":
            {
              summary.add(row);
            }
            break;
        }
      }
    }
  }
Пример #2
0
 private String getGroupParam(Row row) {
   Cell cell = row.getCell(1);
   return cell != null && cell.getCellType() == 1
       ? cell.getStringCellValue().replace("_", "").toUpperCase()
       : "";
 }