ApachePOI
org.apache.poi.xssf.usermodel
XSSFWorkbook
addPivotCache
→ CTWorkbook ctWorkbook = getCTWorkbook();
CTPivotCaches caches;
if (ctWorkbook
.isSetPivotCaches())
caches = ctWorkbook.getPivotCaches();
caches = ctWorkbook.addNewPivotCaches();
CTPivotCache cache = caches.addNewPivotCache();
int tableId = getPivotTables().size()+1;
cache.setCacheId(tableId);
cache.setId(rId);
if
(pivotCaches
== null)
pivotCaches = new ArrayList<CTPivotCache>();
pivotCaches.add(cache);
return cache →
true
false
true
false