Search in sources :

Example 1 with CalcChainDocument

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

the class CalculationChain method writeTo.

public void writeTo(OutputStream out) throws IOException {
    CalcChainDocument doc = CalcChainDocument.Factory.newInstance();
    doc.setCalcChain(chain);
    doc.save(out, DEFAULT_XML_OPTIONS);
}
Also used : CalcChainDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.CalcChainDocument)

Example 2 with CalcChainDocument

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

the class CalculationChain method readFrom.

public void readFrom(InputStream is) throws IOException {
    try {
        CalcChainDocument doc = CalcChainDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
        chain = doc.getCalcChain();
    } catch (XmlException e) {
        throw new IOException(e.getLocalizedMessage());
    }
}
Also used : XmlException(org.apache.xmlbeans.XmlException) IOException(java.io.IOException) CalcChainDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.CalcChainDocument)

Aggregations

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