Thanks
Posts made by דן ברק
-
RE: <xlsxRemove> failed
There's no error in the playgraound. Also I don't get error when I use JSReport version 3.2 on my computer.
The error occurred for me only in JSReport version 4.5Please look at this example I made
https://playground.jsreport.net/w/anon/7lr4OBqo -
<xlsxRemove> failed
I am using JS-Report version 4.5.
I have excel template that start with:
{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}If I remove the first line it works fine. If not the following error occurs:
Report "purple-list-to-excel-v3-ltr" render failed.
"xlsxRemove" helper call failed
(because) cannot read properties of undefined(system-helpers.js line 2891:48)
2889 | const obj = options.data.root.$xlsxTemplate[filePath]
2890 | const collection = evalGet(obj, path)2891 | options.data.root.$removedItem = collection[index]
| ^
2892 | collection.splice(index, 1)
2893 |
2894 | return ''(system-helpers.js line 3257:17)
3255 | }
3256 |3257 | return fn.apply(this, arguments)
| ^
3258 | }
3259 | }
3260 |(system-helpers.js line 3284:28)
3282 | }
3283 | function xlsxRemove (...args) {3284 | return __xlsx.xlsxRemove.call(this, ...args)
| ^
3285 | }
3286 | function xlsxAddImage (...args) {
3287 | return __xlsx.xlsxAddImage.call(this, ...args)TypeError: Cannot read properties of undefined
at Object.remove (system-helpers.js:2891:48)
at Object.eval (system-helpers.js:3257:17)
at Object.xlsxRemove (system-helpers.js:3284:28)
at Object. (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:429:23)
at Object. (/app/node_modules/@jsreport/jsreport-handlebars/lib/handlebarsEngine.js:87:29)
at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
at eval (eval at (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:6197:27)), :90:142)
wrapped by:
Error: "xlsxRemove" helper call failed
(because) cannot read properties of undefined
at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)
at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)
at getEnhancedHelperError (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:425:54)
at Object. (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:431:15)
at Object. (/app/node_modules/@jsreport/jsreport-handlebars/lib/handlebarsEngine.js:87:29)
at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
at eval (eval at (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:6197:27)), :90:142) -
RE: Long duration excel generation
I figured out that my one of my helper functions is causing the problem. It was a currency formatter that use 'Intl.NumberFormat' . After optimizing the code, the excel generation of 15000 rows now takes 7 seconds(reduced form 16 seconds) which I think is more reasonable.
-
RE: Long duration excel generation
I can share the templates. I do I do it ?
-
Long duration excel generation
I am trying to generate excel file of about 15,000 rows and it takes a long time. According to the log file the duration is 16 seconds.
2020-06-28T16:38:09.487Z - info: Rendering request 16375 finished in 16261 ms
2020-06-28T16:38:19.325Z - info: Starting rendering request 16376 (user: null)
2020-06-28T16:38:19.325Z - info: Rendering template { name: list-to-excel-v3, recipe: xlsx, engine: handlebars, preview: false }I am using my own template file with the default xslx confiiguration.
Can you please explain the configuration parameters 'numberOfParsedAddIterations' and 'addBufferSize' ?
I there away to improve the performance ?