当前位置: 首页>>代码示例>>Java>>正文


Java OdfSpreadsheetDocument.loadDocument方法代码示例

本文整理汇总了Java中org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument.loadDocument方法的典型用法代码示例。如果您正苦于以下问题:Java OdfSpreadsheetDocument.loadDocument方法的具体用法?Java OdfSpreadsheetDocument.loadDocument怎么用?Java OdfSpreadsheetDocument.loadDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument的用法示例。


在下文中一共展示了OdfSpreadsheetDocument.loadDocument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: layoutGeneratedOdsFile

import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument; //导入方法依赖的package包/类
public static File layoutGeneratedOdsFile(File generatedOdsFile) {
    File odsOutFile = new File(System.getProperty("java.io.tmpdir") + File.separator + "Layouted_" + generatedOdsFile.getName());

    try {
        OdfSpreadsheetDocument spreadsheet = OdfSpreadsheetDocument.loadDocument(generatedOdsFile);

        List<OdfTable> tableList = spreadsheet.getTableList();
        for (OdfTable table : tableList) {
            table = formatCategories(table);
            table = formatNodes(table);
        }
        spreadsheet.save(odsOutFile);
    } catch (Exception ex) {
        logger.error("Layouting of the OdsFile went wrong.", ex);
    }
    return odsOutFile;
}
 
开发者ID:opennms-forge,项目名称:poc-opennms-spreadsheet-category-manager,代码行数:18,代码来源:SpreadsheetLayouter.java

示例2: getNodeToCategoryMappingsFromFile

import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument; //导入方法依赖的package包/类
public Collection<NodeToCategoryMapping> getNodeToCategoryMappingsFromFile() {
    Map<String, NodeToCategoryMapping> nodesToCategories = new HashMap<>();

    try {
        OdfSpreadsheetDocument spreadsheet = OdfSpreadsheetDocument.loadDocument(this.m_odsFile);

        for (OdfTable table : spreadsheet.getTableList()) {
            nodesToCategories = getNodeToCategoryMappingsFromTable(nodesToCategories, table);
        }

    } catch (Exception ex) {
        logger.error("Reading spreadsheet went wrong", ex);
    }

    return nodesToCategories.values();
}
 
开发者ID:opennms-forge,项目名称:poc-opennms-spreadsheet-category-manager,代码行数:17,代码来源:SpreadsheetReader.java

示例3: OdfWorkbook

import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument; //导入方法依赖的package包/类
public OdfWorkbook(String filename, String encoding) throws KettleException {
  this.filename = filename;
  this.encoding = encoding;
  
  try {
    document = OdfSpreadsheetDocument.loadDocument(KettleVFS.getInputStream(filename));
  } catch(Exception e) {
    throw new KettleException(e);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:11,代码来源:OdfWorkbook.java

示例4: OdfWorkbook

import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument; //导入方法依赖的package包/类
public OdfWorkbook( String filename, String encoding ) throws KettleException {
  this.filename = filename;
  this.encoding = encoding;

  try {
    document = OdfSpreadsheetDocument.loadDocument( KettleVFS.getInputStream( filename ) );
  } catch ( Exception e ) {
    throw new KettleException( e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:11,代码来源:OdfWorkbook.java


注:本文中的org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument.loadDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。