Examples of XWPFTable


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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
          if (element instanceof XWPFSDT){
             extractSDT((XWPFSDT) element, xhtml);
          }
View Full Code Here

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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
      }
    }
View Full Code Here

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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
      }
    }
View Full Code Here

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

        comments.add(new XWPFComment(ctcomment));
      }
     
      for(CTTbl table : getDocumentBody().getTblArray())
      {
        tables.add(new XWPFTable(table));
      }
    }
   
        this.embedds = new LinkedList<PackagePart>();
        for(PackageRelationship rel : getCorePart().getRelationshipsByType(OLE_OBJECT_REL_TYPE)) {
View Full Code Here

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

      }
    }
   
    // Get any tables
    for(CTTbl table : getDocumentBody().getTblArray()) {
      tables.add(new XWPFTable(table));
    }
   
    /// Process embedded document parts
        this.embedds = new LinkedList<PackagePart>();
        for(PackageRelationship rel : getCorePart().getRelationshipsByType(OLE_OBJECT_REL_TYPE)) {
View Full Code Here

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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
      }
    }
View Full Code Here

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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
      }
    }
View Full Code Here

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

          if(element instanceof XWPFParagraph) {
             XWPFParagraph paragraph = (XWPFParagraph)element;
             extractParagraph(paragraph, xhtml);
          }
          if(element instanceof XWPFTable) {
             XWPFTable table = (XWPFTable)element;
             extractTable(table, xhtml);
          }
          if (element instanceof XWPFSDT){
             extractSDT((XWPFSDT) element, xhtml);
          }
View Full Code Here

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

        //XWPFDocument doc = new XWPFDocument(new FileInputStream("base_document.docx"));

      // Create a new table with 6 rows and 3 columns
      int nRows = 6;
      int nCols = 3;
        XWPFTable table = doc.createTable(nRows, nCols);

        // Set the table style. If the style is not defined, the table style
        // will become "Normal".
        CTTblPr tblPr = table.getCTTbl().getTblPr();
        CTString styleStr = tblPr.addNewTblStyle();
        styleStr.setVal("StyledTable");

        // Get a list of the rows in the table
        List<XWPFTableRow> rows = table.getRows();
        int rowCt = 0;
        int colCt = 0;
        for (XWPFTableRow row : rows) {
          // get table row properties (trPr)
          CTTrPr trPr = row.getCtRow().addNewTrPr();
View Full Code Here

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

  public static void main(String[] args) throws Exception
  {
    XWPFDocument document = new XWPFDocument();
   
    // New 2x2 table
    XWPFTable tableOne = document.createTable();
    XWPFTableRow tableOneRowOne = tableOne.getRow(0);
    tableOneRowOne.getCell(0).setText("Hello");
    tableOneRowOne.addNewTableCell().setText("World");
   
    XWPFTableRow tableOneRowTwo = tableOne.createRow();
    tableOneRowTwo.getCell(0).setText("This is");
    tableOneRowTwo.getCell(1).setText("a table");
   
    // Add a break between the tables
    document.createParagraph().createRun().addBreak();
   
    // New 3x3 table
    XWPFTable tableTwo = document.createTable();
    XWPFTableRow tableTwoRowOne = tableTwo.getRow(0);
    tableTwoRowOne.getCell(0).setText("col one, row one");
    tableTwoRowOne.addNewTableCell().setText("col two, row one");
    tableTwoRowOne.addNewTableCell().setText("col three, row one");
   
    XWPFTableRow tableTwoRowTwo = tableTwo.createRow();
    tableTwoRowTwo.getCell(0).setText("col one, row two");
    tableTwoRowTwo.getCell(1).setText("col two, row two");
    tableTwoRowTwo.getCell(2).setText("col three, row two");
   
    XWPFTableRow tableTwoRowThree = tableTwo.createRow();
    tableTwoRowThree.getCell(0).setText("col one, row three");
    tableTwoRowThree.getCell(1).setText("col two, row three");
    tableTwoRowThree.getCell(2).setText("col three, row three");
   
    FileOutputStream outStream = new FileOutputStream("data/Apache_CreateTable.doc");
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.