Skip to content

Commit f7835d6

Browse files
committed
Add support for outline configuration
- "Summary rows below detail" - "Summary columns to right of detail"
1 parent eec93b0 commit f7835d6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@ In addition to the base sheet keys, worksheets also add:
10931093
will write all cells in the merge range if they exist, so be sure that only
10941094
the first cell (upper-left) in the range is set.
10951095

1096+
- `ws['!outline']`: configure how outlines should behave.
1097+
Example: `{above: true}` - equivalent of unchecking the Excel option "Summary rows below detail".
1098+
`{left: true}` - equivalent of unchecking the Excel option "Summary option to the right of detail."
1099+
10961100
- `ws['!protect']`: object of write sheet protection properties. The `password`
10971101
key specifies the password for formats that support password-protected sheets
10981102
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following

bits/67_wsxml.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
114114
props.codeName = escapexml(cname);
115115
}
116116

117+
if(ws && ws["!outline"]) {
118+
var outlineprops = {summaryBelow:1, summaryRight:1};
119+
if(ws["!outline"].above) outlineprops.summaryBelow = 0;
120+
if(ws["!outline"].left) outlineprops.summaryRight = 0;
121+
payload = (payload||"") + writextag('outlinePr', null, outlineprops);
122+
}
123+
117124
if(!needed && !payload) return;
118125
o[o.length] = (writextag('sheetPr', payload, props));
119126
}

0 commit comments

Comments
 (0)