Search in sources :

Example 1 with TableDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument in project poi by apache.

the class XSSFTable method readFrom.

/**
     * read table XML
     * @param is
     * @throws IOException
     */
public void readFrom(InputStream is) throws IOException {
    try {
        TableDocument doc = TableDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
        ctTable = doc.getTable();
    } catch (XmlException e) {
        throw new IOException(e.getLocalizedMessage());
    }
}
Also used : TableDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument) XmlException(org.apache.xmlbeans.XmlException) IOException(java.io.IOException)

Example 2 with TableDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument in project poi by apache.

the class XSSFTable method writeTo.

/**
     * write table XML to stream
     * @param out
     * @throws IOException
     */
public void writeTo(OutputStream out) throws IOException {
    updateHeaders();
    TableDocument doc = TableDocument.Factory.newInstance();
    doc.setTable(ctTable);
    doc.save(out, DEFAULT_XML_OPTIONS);
}
Also used : TableDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument)

Aggregations

TableDocument (org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument)2 IOException (java.io.IOException)1 XmlException (org.apache.xmlbeans.XmlException)1