Examples of XWPFTableCell


Examples of org.apache.poi.xwpf.usermodel.XWPFTableCell

   private void appendTableText(StringBuffer text, XWPFTable table){
      //this works recursively to pull embedded tables from tables
      for (XWPFTableRow row : table.getRows()){
          List<XWPFTableCell> cells = row.getTableCells();
          for (int i = 0; i < cells.size(); i++){
              XWPFTableCell cell = cells.get(i);
              text.append(cell.getTextRecursively());
              if (i < cells.size()-1){
                  text.append("\t");
              }
          }
          text.append('\n');
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFTableCell

   private void appendTableText(StringBuffer text, XWPFTable table){
      //this works recursively to pull embedded tables from tables
      for (XWPFTableRow row : table.getRows()){
          List<XWPFTableCell> cells = row.getTableCells();
          for (int i = 0; i < cells.size(); i++){
              XWPFTableCell cell = cells.get(i);
              text.append(cell.getTextRecursively());
              if (i < cells.size()-1){
                  text.append("\t");
              }
          }
          text.append('\n');
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFTableCell

            //check if row needs to be iterated or stretched.
            if (tabRow.getCell(dynamicColumnAddIndex).getCTTc().getTcPr().isSetGridSpan()) {
                BigInteger gridSpanVal = tabRow.getCell(dynamicColumnAddIndex).getCTTc().getTcPr().getGridSpan().getVal();
                tabRow.getCell(dynamicColumnAddIndex).getCTTc().getTcPr().getGridSpan().setVal(gridSpanVal.add(BigInteger.valueOf(columnDataList.size() - 1)));
            } else {
                XWPFTableCell tempCell = tabRow.getCell(dynamicColumnAddIndex);
                //add new cells to the row.
                for (int colC = 0; colC < columnDataList.size() - 1; colC++) {
                    XWPFTableCell tableCell = new XWPFTableCell(ctRow.insertNewTc(dynamicColumnAddIndex + colC), tabRow, getTable().getBody());
                    tabRow.getTableCells().add(dynamicColumnAddIndex + colC, tableCell);
                    DocXEngine.copyCell(tempCell, tableCell);
                }
            }
        }
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFTableCell

        // create dynamic columns
        for (int rowC = 0; rowC < (rowDataList.size() - 1); rowC++) {
            //XWPFTableRow newRow = new XWPFTableRow(tempRow.getCtRow(), getTable());
            XWPFTableRow newRow = getTable().insertNewTableRow(dynamicRowAddC);
            for (XWPFTableCell cell : tempRow.getTableCells()) {
                XWPFTableCell newCell = newRow.createCell();
                DocXEngine.copyCell(cell, newCell);
            }
        }
        dynamicRowIndex = tempRowC;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.