-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
```js worksheet.addPivotTable(configuration); ``` **Note:** Pivot table support is in its early stages with certain limitations, including: - No support for reading xlsx documents with existing pivot tables (writing is supported). - Pivot table configurations must consist of 2 rows, 1 column, 1 value, and use the sum metric. The source data can have any number of columns and rows. - Only one pivot table can be added.
- Loading branch information
Showing
17 changed files
with
934 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
OfficeDocument: | ||
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', | ||
OfficeDocument: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', | ||
Worksheet: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet', | ||
CalcChain: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain', | ||
SharedStrings: | ||
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings', | ||
SharedStrings: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings', | ||
Styles: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles', | ||
Theme: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', | ||
Hyperlink: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', | ||
Image: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', | ||
CoreProperties: | ||
'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', | ||
ExtenderProperties: | ||
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', | ||
CoreProperties: 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', | ||
ExtenderProperties: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', | ||
Comments: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', | ||
VmlDrawing: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', | ||
Table: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table', | ||
PivotCacheDefinition: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition', | ||
PivotCacheRecords: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords', | ||
PivotTable: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const BaseXform = require('../base-xform'); | ||
|
||
class WorkbookPivotCacheXform extends BaseXform { | ||
render(xmlStream, model) { | ||
xmlStream.leafNode('pivotCache', { | ||
cacheId: model.cacheId, | ||
'r:id': model.rId, | ||
}); | ||
} | ||
|
||
parseOpen(node) { | ||
if (node.name === 'pivotCache') { | ||
this.model = { | ||
cacheId: node.attributes.cacheId, | ||
rId: node.attributes['r:id'], | ||
}; | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
parseText() {} | ||
|
||
parseClose() { | ||
return false; | ||
} | ||
} | ||
|
||
module.exports = WorkbookPivotCacheXform; |
Oops, something went wrong.