org.apache.poi.xssf.usermodel.XSSFWorkbook.getPivotTables()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFWorkbook.getPivotTables()方法的一些代码示例,展示了XSSFWorkbook.getPivotTables()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFWorkbook.getPivotTables()方法的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFWorkbook
类名称:XSSFWorkbook
方法名:getPivotTables

XSSFWorkbook.getPivotTables介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Returns all the pivot tables for this Sheet
 */
@Beta
public List<XSSFPivotTable> getPivotTables() {
  List<XSSFPivotTable> tables = new ArrayList<>();
  for (XSSFPivotTable table : getWorkbook().getPivotTables()) {
    if (table.getParent() == this) {
      tables.add(table);
    }
  }
  return tables;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Add pivotCache to the workbook
 */
@Beta
protected CTPivotCache addPivotCache(String rId) {
  CTWorkbook ctWorkbook = getCTWorkbook();
  CTPivotCaches caches;
  if (ctWorkbook.isSetPivotCaches()) {
    caches = ctWorkbook.getPivotCaches();
  } else {
    caches = ctWorkbook.addNewPivotCaches();
  }
  CTPivotCache cache = caches.addNewPivotCache();
  int tableId = getPivotTables().size()+1;
  cache.setCacheId(tableId);
  cache.setId(rId);
  if(pivotCaches == null) {
    pivotCaches = new ArrayList<>();
  }
  pivotCaches.add(cache);
  return cache;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

protected void read(InputStream is) throws IOException {
  try {
    worksheet = WorksheetDocument.Factory.parse(is, DEFAULT_XML_OPTIONS).getWorksheet();
  } catch (XmlException e){
    throw new POIXMLException(e);
  }
  initRows(worksheet);
  columnHelper = new ColumnHelper(worksheet);
  // Look for bits we're interested in
  for(RelationPart rp : getRelationParts()){
    POIXMLDocumentPart p = rp.getDocumentPart();
    if(p instanceof CommentsTable) {
      sheetComments = (CommentsTable)p;
    }
    if(p instanceof XSSFTable) {
      tables.put( rp.getRelationship().getId(), (XSSFTable)p );
    }
    if(p instanceof XSSFPivotTable) {
      getWorkbook().getPivotTables().add((XSSFPivotTable) p);
    }
  }
  // Process external hyperlinks for the sheet, if there are any
  initHyperlinks();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

private XSSFPivotTable createPivotTable() {
  XSSFWorkbook wb = getWorkbook();
  List<XSSFPivotTable> pivotTables = wb.getPivotTables();
  int tableId = getWorkbook().getPivotTables().size()+1;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Returns all the pivot tables for this Sheet
 */
@Beta
public List<XSSFPivotTable> getPivotTables() {
  List<XSSFPivotTable> tables = new ArrayList<>();
  for (XSSFPivotTable table : getWorkbook().getPivotTables()) {
    if (table.getParent() == this) {
      tables.add(table);
    }
  }
  return tables;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Add pivotCache to the workbook
 */
@Beta
protected CTPivotCache addPivotCache(String rId) {
  CTWorkbook ctWorkbook = getCTWorkbook();
  CTPivotCaches caches;
  if (ctWorkbook.isSetPivotCaches()) {
    caches = ctWorkbook.getPivotCaches();
  } else {
    caches = ctWorkbook.addNewPivotCaches();
  }
  CTPivotCache cache = caches.addNewPivotCache();
  int tableId = getPivotTables().size()+1;
  cache.setCacheId(tableId);
  cache.setId(rId);
  if(pivotCaches == null) {
    pivotCaches = new ArrayList<>();
  }
  pivotCaches.add(cache);
  return cache;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

protected void read(InputStream is) throws IOException {
  try {
    worksheet = WorksheetDocument.Factory.parse(is, DEFAULT_XML_OPTIONS).getWorksheet();
  } catch (XmlException e){
    throw new POIXMLException(e);
  }
  initRows(worksheet);
  columnHelper = new ColumnHelper(worksheet);
  // Look for bits we're interested in
  for(RelationPart rp : getRelationParts()){
    POIXMLDocumentPart p = rp.getDocumentPart();
    if(p instanceof CommentsTable) {
      sheetComments = (CommentsTable)p;
    }
    if(p instanceof XSSFTable) {
      tables.put( rp.getRelationship().getId(), (XSSFTable)p );
    }
    if(p instanceof XSSFPivotTable) {
      getWorkbook().getPivotTables().add((XSSFPivotTable) p);
    }
  }
  // Process external hyperlinks for the sheet, if there are any
  initHyperlinks();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

private XSSFPivotTable createPivotTable() {
  XSSFWorkbook wb = getWorkbook();
  List<XSSFPivotTable> pivotTables = wb.getPivotTables();
  int tableId = getWorkbook().getPivotTables().size()+1;

相关文章

微信公众号

最新文章

更多

XSSFWorkbook类方法