提交 f7835d67 编写于 作者: R Robin Hu

Add support for outline configuration

- "Summary rows below detail"
- "Summary columns to right of detail"
上级 eec93b0b
...@@ -1093,6 +1093,10 @@ In addition to the base sheet keys, worksheets also add: ...@@ -1093,6 +1093,10 @@ In addition to the base sheet keys, worksheets also add:
will write all cells in the merge range if they exist, so be sure that only will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set. the first cell (upper-left) in the range is set.
- `ws['!outline']`: configure how outlines should behave.
Example: `{above: true}` - equivalent of unchecking the Excel option "Summary rows below detail".
`{left: true}` - equivalent of unchecking the Excel option "Summary option to the right of detail."
- `ws['!protect']`: object of write sheet protection properties. The `password` - `ws['!protect']`: object of write sheet protection properties. The `password`
key specifies the password for formats that support password-protected sheets key specifies the password for formats that support password-protected sheets
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following (XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
......
...@@ -114,6 +114,13 @@ function write_ws_xml_sheetpr(ws, wb, idx, opts, o) { ...@@ -114,6 +114,13 @@ function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
props.codeName = escapexml(cname); props.codeName = escapexml(cname);
} }
if(ws && ws["!outline"]) {
var outlineprops = {summaryBelow:1, summaryRight:1};
if(ws["!outline"].above) outlineprops.summaryBelow = 0;
if(ws["!outline"].left) outlineprops.summaryRight = 0;
payload = (payload||"") + writextag('outlinePr', null, outlineprops);
}
if(!needed && !payload) return; if(!needed && !payload) return;
o[o.length] = (writextag('sheetPr', payload, props)); o[o.length] = (writextag('sheetPr', payload, props));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册