Recipe using docxtemplater to generate docx reports
npm install @jsreport/jsreport-docxtemplater
See general documentation for office preview in studio here.
{
"template": {
"recipe": "docxtemplater",
"engine": "handlebars",
"docxtemplater": {
"templateAssetShortid": "xxxx"
}
},
"data": {}
}
In case you don't have the office template stored as an asset you can send it directly in the API call.
{
"template": {
"recipe": "docxtemplater",
"engine": "handlebars",
"docxtemplater": {
"templateAsset": {
"content": "base64 encoded word file",
"encoding": "base64"
}
}
},
"data": {}
}