Skip to content

Commit 563efd8

Browse files
seriousbenSheetJSDev
authored andcommitted
XLSX write sheetFormat option (fixes SheetJS#437)
note: @SheetJSDev authored commit, original PR date/author used
1 parent 4743085 commit 563efd8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

bits/67_wsxml.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
323323
o[o.length] = (writextag('sheetPr', null, {'codeName': escapexml(wb.SheetNames[idx])}));
324324
o[o.length] = (writextag('dimension', null, {'ref': ref}));
325325

326+
/* TODO: store in WB, process styles */
327+
if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10' }))
328+
326329
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
327330
o[sidx = o.length] = '<sheetData/>';
328331
ws['!links'] = [];

xlsx.flow.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9224,6 +9224,9 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
92249224
o[o.length] = (writextag('sheetPr', null, {'codeName': escapexml(wb.SheetNames[idx])}));
92259225
o[o.length] = (writextag('dimension', null, {'ref': ref}));
92269226

9227+
/* TODO: store in WB, process styles */
9228+
if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10' }))
9229+
92279230
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
92289231
o[sidx = o.length] = '<sheetData/>';
92299232
ws['!links'] = [];

xlsx.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9169,6 +9169,9 @@ function write_ws_xml(idx, opts, wb, rels) {
91699169
o[o.length] = (writextag('sheetPr', null, {'codeName': escapexml(wb.SheetNames[idx])}));
91709170
o[o.length] = (writextag('dimension', null, {'ref': ref}));
91719171

9172+
/* TODO: store in WB, process styles */
9173+
if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10' }))
9174+
91729175
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
91739176
o[sidx = o.length] = '<sheetData/>';
91749177
ws['!links'] = [];

0 commit comments

Comments
 (0)