Can you validate on server that key "scripts" is not null or empty string (''), before throw error "template.scripts should be array"? We have a lot of troubles with update our clients.
Posts made by Денис Ковале
-
RE: Generation does not work
-
RE: Generation does not work
The key "scripts" were always empty string, now it is deleted.
-
RE: Generation does not work
{
"url": "https://prebook.jsreportonline.net/api/report",
"method": "POST",
"auth": {
"username": delete,
"password": delete,
},
"data": {
"template": {
"content": "\n\t\t\t{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.sheetData" 0}}\n\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData"}}<sheetData />{{/xlsxAdd}}\n\t\t\t\n\t\t\t{{#xlsxMerge "xl/workbook.xml" "workbook.sheets[0].sheet[0]"}}\n <sheet name="{{{reportName}}}"/>\n\t\t\t{{/xlsxMerge}}\n\t\t\t{{#if dayDiff}}\n\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t<row r="{{#getNumPlus 1}}{{/getNumPlus}}"><c s="1" t="inlineStr"><is><t>{{{reportName}}} "{{cinema}}" с {{startDate}} по {{finishDate}}</t></is></c></row>\n\t\t\t\t{{/xlsxAdd}}\n\t\t\t{{else}}\n\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t<row r="{{#getNumPlus 1}}{{/getNumPlus}}"><c s="1" t="inlineStr"><is><t>{{{reportName}}} "{{cinema}}" на {{startDate}}</t></is></c></row>\n\t\t\t\t{{/xlsxAdd}}\n\t\t\t{{/if}}\n\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\n\t\t\t{{xlsxRemove "xl/workbook.xml" "workbook.definedNames" 0}}\n\t\t\t\n\t\t\t{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.cols" 0}}\n\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.cols"}}\n\t\t\t<cols>\n\t\t\t\t<col min="1" max="1" width="12" customWidth="1"/>\n\t\t\t\t<col min="2" max="2" width="8" customWidth="1"/>\n\t\t\t\t<col min="3" max="3" width="10" customWidth="1"/>\n\t\t\t\t<col min="4" max="4" width="40" customWidth="1"/>\n\t\t\t\t<col min="5" max="5" width="9" customWidth="1"/>\n\t\t\t\t<col min="6" max="6" width="18" customWidth="1"/>\n\t\t\t</cols>\n\t\t\t{{/xlsxAdd}}\n\t\t\t\n\t\t\t{{#unless dayDiff}}\n\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t<row r="{{#getNumPlus 1}}{{/getNumPlus}}">\n\t\t\t\t\t<c s="3" t="inlineStr"><is><t>С</t></is></c>\n\t\t\t\t\t<c s="3" t="inlineStr"><is><t>До</t></is></c>\n\t\t\t\t\t<c s="3" t="inlineStr"><is><t>Пер.</t></is></c>\n\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Фильм</t></is></c>\n\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Формат</t></is></c>\n\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Цена</t></is></c>\n\t\t\t\t</row>\n\t\t\t\t{{/xlsxAdd}}\n\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t{{/unless}}\n\t\t\t\n\t\t\t{{#each halls as |hall|}}\n\t\t\t\t\n\t\t\t\t{{#if ../dayDiff}}\n\t\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t<row r="{{#getNumPlus 1}}{{/getNumPlus}}">\n\t\t\t\t\t\t<c s="3" t="inlineStr"><is><t>С</t></is></c>\n\t\t\t\t\t\t<c s="3" t="inlineStr"><is><t>До</t></is></c>\n\t\t\t\t\t\t<c s="3" t="inlineStr"><is><t>Пер.</t></is></c>\n\t\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Фильм</t></is></c>\n\t\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Формат</t></is></c>\n\t\t\t\t\t\t<c s="4" t="inlineStr"><is><t>Цена</t></is></c>\n\t\t\t\t\t</row>\n\t\t\t\t\t{{/xlsxAdd}}\n\t\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\t{{/if}}\n\t\t\t\t\n\t\t\t\t{{#unless ../dayDiff}}\n\t\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t\t<row r="{{#getNumPlus 1}}{{/getNumPlus}}">\n\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t<c customHeight="1" ht="23" s="6" t="inlineStr"><is><t>{{hall.hallName}}</t></is></c>\n\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t</row>\n\t\t\t\t\t{{/xlsxAdd}}\n\t\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\t{{/unless}}\n\t\t\t\t\n\t\t\t\t{{#each hallRows}}\n\t\t\t\t\t{{#if ../../dayDiff}}\n\t\t\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t\t\t<row customHeight="1" ht="18" r="{{#getNumPlus 1}}{{/getNumPlus}}">\n\t\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t\t<c t="inlineStr" s="6"><is><t>{{day}} - {{hall.hallName}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t\t<c s="5"/>\n\t\t\t\t\t\t\t</row>\n\t\t\t\t\t\t{{/xlsxAdd}}\n\t\t\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{#each dayRows}}\n\t\t\t\t\t\t{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}\n\t\t\t\t\t\t\t<row customHeight="1" ht="{{#height priceSchema 18}}{{/height}}" r="{{#getNumPlus 1}}{{/getNumPlus}}">\n\t\t\t\t\t\t\t\t<c s="7" t="inlineStr"><is><t>{{showStart}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="7" t="inlineStr"><is><t>{{showEnd}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="7" t="inlineStr"><is><t>{{publish}}{{breakTime}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="9" t="inlineStr"><is><t>{{eventName}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="9" t="inlineStr"><is><t>{{eventFormat}}</t></is></c>\n\t\t\t\t\t\t\t\t<c s="2" t="inlineStr"><is><t>{{#concatStr priceSchema pricePrices}}{{/concatStr}}</t></is></c>\n\t\t\t\t\t\t\t</row>\n\t\t\t\t\t\t{{/xlsxAdd}}\n\t\t\t\t\t\t{{#incNum 1}}{{/incNum}}\n\t\t\t\t\t{{/each}}\n\t\t\t\t{{/each}}\n\t\t\t\t\n\t\t\t{{/each}}\n\n\t\t\t{{#xlsxMerge "xl/workbook.xml" "workbook.calcPr[0]"}}\n\t\t\t <calcPr fullCalcOnLoad="1"/>\n\t\t\t{{/xlsxMerge}}\n\n\t\t\t{{{xlsxPrint}}}\n\t\t\t",
"engine": "handlebars",
"recipe": "xlsx",
"xlsxTemplate": {
"shortid": "BkJi1bMh-"
},
"helpers": "\n\t\t\t\tfunction concatStr(str1, str2) {\n\t\t\t\t return str1 ? str1 + '\n' + str2 : str2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction height(str, val) {\n\t\t\t\t return str ? val * 2 : val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnum = 0;\n\t\t\t\t\n\t\t\t\tfunction incNum(val) {\n\t\t\t\t num += val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction getNumPlus(val) {\n\t\t\t\t return num + val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction getNum() {\n\t\t\t\t return num;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction nullNum() {\n\t\t\t\t num = 0;\n\t\t\t\t}\n\t\t\t",
"scripts": "",
"omitDataFromOutput": false
},
"data": {
"cinema": "Кинотеатр Родина",
"startDate": "06.09.18",
"finishDate": "06.09.18",
"dayDiff": false,
"created_at": "6 сентября 2018 г. в 12:48",
"halls": [],
"city": "Энгельс",
"reportName": "Репертуарный план"
}
},
"options": {
"debug": {
"logsToResponse": true,
"logsToResponseHeader": true
}
}
} -
RE: Generation does not work
I sent a request containing scripts = ''. Сorrected it, not for long it worked -
came a positive response. Now the error "credits used: NaN". -
RE: Generation does not work
The first is easy to solve, but a little unexpected.
-
RE: Generation does not work
Thank you for the clarification. The second point is not yet critical.
-
Generation does not work
Today, the generation of Excel reports has ceased to work - "template input in request contains values that does not match the defined schema. Schema validation errors: template.scripts should be array". Nothing has changed.
When trying to make an empty test template in "studio / templates" - "Error: Maximum of the credits allowed for your plan (50% +) reached, please upgrade your plan or contact support." Credits used: NaN, Credits Available: 10000"