Ejemplo n.º 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;
        }
      }
    }
  }
Ejemplo n.º 2
0
  private void process(Sheet oldSheet, Sheet newSheet) {
    printSetup(oldSheet, newSheet);

    title = new TBand(newSheet);
    detail = new TBand(newSheet);
    summary = new TBand(newSheet);

    oldSheet.rowIterator().forEachRemaining(this::processRow);

    widthSetup(oldSheet, newSheet);
    title.addMerged(oldSheet);
    detail.addMerged(oldSheet);
    summary.addMerged(oldSheet);

    title.paint(header, false);
    detail.paint(master, true);
    master.concat(header);
    summary.paint(master, false);
  }