Syntax for adding xlsx col properties - escaping double quotes?
-
Hi,
I am attempting to add a col element to an xlsx sheet to define custom column widths.
This works:
The first two columns are wider.
What need to do it add these cols dynamically, from an object in the script colWidths that has two properties, the index and width I want to set the column to.
This does not work, and I assume that it has to do with the double quotes, but I can't wrap the {{values}} in double quotes as that does not work in handlebars.
Any ideas?
Regards,
Ari
-
Seems to work fine for me
https://playground.jsreport.net/w/anon/MhAYQluo{{#xlsxReplace "xl/worksheets/sheet1.xml" "worksheet.cols"}} <cols> {{#each colWidths}} <col min="{{index}}" max="{{index}}" width="{{width}}" customWidth="1" /> {{/each}} </cols> {{/xlsxReplace}}
-
So it does, thanks for the confirmation