You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Used docxtemplater-modules : "docxtemplater-xlsx-module"
Runner : Browser
How to reproduce my problem :
My template is the following (rename template.xlsx) : template.zip
With the following js file :
varfs=require('fs');varDocxtemplater=require('docxtemplater');varXlsxModule=require("./docxtemplater-xlsx-module");varxlsxModule=newXlsxModule({});//Load the docx file as a binaryvarcontent=fs.readFileSync(__dirname+"/template.zip","binary");varzip=newPizZip(content);vardoc=newDocxtemplater()doc.attachModule(xlsxModule)doc.loadZip(zip)//set the templateVariablesdoc.setData({name: "John Doe",totalPrice: {type: "currency",value: 100,},discount: {type: "percent",value: 0.195,},items: [{name: "First product",quantity: 1,unit_price: {type: "currency",value: 200},},{name: "Other product",quantity: 3,unit_price: {type: "currency",value: 100},},],};);//apply them (replace all occurences of {first_name} by Hipp, ...)doc.render();varbuf=doc.getZip().generate({type:"nodebuffer"});fs.writeFileSync(__dirname+"/output.docx",buf);
I would expect it to return the following template, with new sheets created inside the workbook: generated.zip
With the module pptx-slides, we can create new slides inside a pptx template with a simple loop.
It would be a great improvement to create new sheets inside an Excel Workbook with the same kind of syntax.
The text was updated successfully, but these errors were encountered:
Environment
How to reproduce my problem :
My template is the following (rename template.xlsx) :
template.zip
With the following js file :
I would expect it to return the following template, with new sheets created inside the workbook:
generated.zip
With the module pptx-slides, we can create new slides inside a pptx template with a simple loop.
It would be a great improvement to create new sheets inside an Excel Workbook with the same kind of syntax.
The text was updated successfully, but these errors were encountered: