This corrected it. thank you
Posts made by zewar96
-
Error in 4.9.0
In upgrading to 4.9.0 we use the JSReport .Net NuGet packages (v. 3.8.2) for doing
var report = await rs.RenderAsync(new RenderRequest() { Template = template, Data = reportContent, Options = new RenderOptions { Preview = false, Reports = new ReportsOptions { Save = true }, Timeout = 300000 } });
Up until this point everything has been fine, but this new version has now started throwing the error below. No other code has changed. This seems to be happening on our Excel files when downloading
Error when processing render request 53 (because) column "meta" of relation "jsreport_ReportType" does not exist error: column "meta" of relation "jsreport_ReportType" does not exist at Parser.parseErrorMessage (/app-rprt/node_modules/pg-protocol/dist/parser.js:285:98) at Parser.handlePacket (/app-rprt/node_modules/pg-protocol/dist/parser.js:122:29) at Parser.parse (/app-rprt/node_modules/pg-protocol/dist/parser.js:35:38) at TLSSocket.<anonymous> (/app-rprt/node_modules/pg-protocol/dist/index.js:11:42) at TLSSocket.emit (node:events:524:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)
If we change the code to below it works
var report = await rs.RenderAsync(new RenderRequest() { Template = template, Data = reportContent, Options = new RenderOptions { Preview = false, Reports = new ReportsOptions { Save = false }, Timeout = 300000 } });
-
RE: new 4.3.0 won't render PDF
It's definitely an issue with jsreports to chromium, but i don't know what it would be. If i run my docker to a bash shell and then execute
/app-rprt$ /usr/bin/chromium-browser --no-sandbox --disable-dev-shm-usage --headless --disable-gpu --print-to-pdf $1
it generates output.pdf with content in it. This is the output though.
[0322/121710.387637:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [0322/121710.391744:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [0322/121710.391805:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [0322/121710.400029:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable. [0322/121710.441692:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process. 659 bytes written to file output.pdf
Not sure if that matters or not in what you guys are doing with the return. I did not run your docker to see what the output looks like on your side. Could you please let me know if you think this is the issue?
-
RE: new 4.3.0 won't render PDF
We don't do anything with OracleDB, so i am assuming i don't need anything with that section.
We had this in there from before. Not sure if it's needed or not:
WORKDIR /${APPDIR} # the chrome was already installed from apt-get ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true ENV NODE_OPTIONS "--openssl-legacy-provider" RUN npm install -g @jsreport/jsreport-cli RUNN npm install -g @jsreport/jsreport-unoconv RUN jsreport init
We use elasticSearch in our for logging, so i have
RUN npm install --save winston winston-elasticsearch
We have a couple more NPM packages
RUN npm install --save chart.js RUN npm install --save request
I also have a couple of extra lines at the bottom that we may not need:
ENV PATH "$PATH:/fop-2.1" ENV NODE_ENV production #ENV chrome_launchOptions_executablePath /usr/bin/chromium-browser ENV chrome_launchOptions_args --no-sandbox,--disable-dev-shm-usage
Everything else lines up. The versions all match for NPM packages. Anything else that's in our dockerfile are AWS specific for our hosting
-
new 4.3.0 won't render PDF
We upgraded to the latest version to test with and it won't render any of our PDFs. To be sure, we took an export of https://playground.jsreport.net/w/admin/hBfqC7af and imported it in to our environment and it just hangs at "Executing recipe chrome-pdf". If we run this same thing on 4.2 we do not have any issues. We did not change our docker at all except to install the new version so it's still got this line in it for Chrome:
apt install -y chromium-browser=112.0.5615.49-0ubuntu0.18.04.1 chromium-codecs-ffmpeg=112.0.5615.49-0ubuntu0.18.04.1 && \ -
Issue on Export from Studio
We updated to 4.0 and we are getting weird behavior with checkboxes when trying to export. We have lots of folders and on average about 6 files per folder. When I right click on a folder in Studio and click Export Folder, it brings up a dialog with the folder and all files selected. If i try to change checkboxes, it selects different files. This is making the export difficult to select what we want and move those files over to our production setup
You can see this behavior here:
https://www.flexclip.com/share/38848218a5d023d4e961062aa32c703c6c4b3e3.html
-
Office Preview with OOS
I was wondering if you guys have done anything with the Office Online Server to be able to have a private server for office preview. I know you have configuration on where to store the files (on our server vs. yours), but what about being able to change the actual previewing server from MS's public server to using Office Online Server which is free if you want to be able to have it in read-only mode. I am looking at trying to set up a proof of concept server to be able to preview documents internally on our servers for a secured site and I would love the ability to be able to offer the same through JSReport templates that we have already setup.
Thanks,
Justin -
RE: xlsx recipe: Error when evaluating with new version
For our stuff, it was because the SUM() formula that was in our template file referenced a cell that was below it. We actually didn't modify anything via code in the xlsx recipe and just put in the xslxPrint command and it threw that error, so it's validating things that aren't even touching. Excel had no problem with the forumla using a cell below what was being summed, but JSReport did. So we had to rip out the formula and manually calculate it ourself and then put the Replace command in there to write the value instead of the formula
-
RE: xlsx recipe: Error when evaluating with new version
as an FYI, we ran in to the same issue and had to code around it. It seems more checking was added to make sure things didn't go out of bounds and changing the order to make sure the cells were created before this was done was our only solution. Sort of a pain, but it did work for us
-
RE: Nested Each slow performing
That's fantastic news. Thanks for digging in to this as i know it wasn't easy to find and fix. Hopefully the performance improvements will be a benefit to everyone. I know they will be huge for us and save us from having to rewrite a bunch of reports using a non-standard way.
-
RE: Nested Each slow performing
Checking on status. Have you found the underlying cause of the slowness?
-
RE: Script interactions
I may not be describing things correctly, but i am trying to access variables from within helpers, not scripts. Does that matter?
I will work on getting you a playground entry to look at so you can see, but if the helpers can't run the beforeRender and don't have access to variables within the global, it won't really matter much
-
Script interactions
This may be a weird scenario but i thought i would ask if it's possible. We have a template for Excel recipe generation (doesn't matter which we use). We also have a global JS file that has reusable methods in it for our other templates. Is it possible that the template can access variables in the global or more specifically, override the values?
The idea we have is like the way CSS works, but we need it for style building in Excel. We have already created our own style builder and want to be able to extend it a bit more. We would like to have a variable in the global JS file like this
let Styles = "{ blah blah blah }";
and then in the template be able to Merge any additional styles on top of that So in the template we would do:
Styles = object.assign(Styles, "{ my overrides or additional styles }");
The issue we are having is being able to access the global properties from within the template itself.
-
RE: Nested Each slow performing
any ideas on what is causing this slowness? i don't want to have to move to this new reporting style as it's very hard to read/maintain
-
RE: How to go back from all all inner #each loops
You can use the ../ operator to traverse back up the tree if you need to. So to go up 3 levels it would be ../../../variable
-
RE: Nested Each slow performing
a sample workspace was created
https://playground.jsreport.net/w/zewar96/ORg9CbKrif you run the top section only (the fast one), according to profile, "Successfully zipped now." takes 2751ms
if you run the bottom section only (the slow one), according to profile, "Successfully zipped now." takes 9622ms.The only difference between these 2 are that one uses the #each in handlebars and the other uses the same loop and same process, but does it all in JS and returns a single value. I played with this a bunch and even if i remove any of the lookups that i do an put in static values, the #each is still significantly slower and i don't know why.
-
RE: Nested Each slow performing
Yes, this is the xlsx recipe.
We use the xslxAdd helper
Here is an example of the From and the To
{{#each data}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}} <row> <c t="inlineStr"><is><t>{{field1}}</t></is></c> <c t="inlineStr"><is><t>{{field2}}</t></is></c> <c t="inlineStr"><is><t>{{field3}}</t></is></c> <c t="inlineStr"><is><t>{{field4}}</t></is></c> <c t="inlineStr"><is><t>{{field5}}</t></is></c> <c s="11"><v>{{getDayDif startDate}}</v></c> <c s="11"><v>{{getDayDif endDate}}</v></c> <c t="inlineStr"><is><t>{{field6}}</t></is></c> <c t="inlineStr"><is><t>{{field7}}</t></is></c> <c t="inlineStr" s="9"><is><t>{{field8}}</t></is></c> {{#each ../customAttributes}} <c t="inlineStr"><is><t>{{getAttributeValue ../attributes id 0}}</t></is></c> {{/each}} </row> {{/xlsxAdd}} {{/each}}
This was changed to:
{{#each data}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}} <row> <c t="inlineStr"><is><t>{{field1}}</t></is></c> <c t="inlineStr"><is><t>{{field2}}</t></is></c> <c t="inlineStr"><is><t>{{field3}}</t></is></c> <c t="inlineStr"><is><t>{{field4}}</t></is></c> <c t="inlineStr"><is><t>{{field5}}</t></is></c> <c s="11"><v>{{getDayDif startDate}}</v></c> <c s="11"><v>{{getDayDif endDate}}</v></c> <c t="inlineStr"><is><t>{{field6}}</t></is></c> <c t="inlineStr"><is><t>{{field7}}</t></is></c> <c t="inlineStr" s="9"><is><t>{{field8}}</t></is></c> {{{outputCustomAttributes ../customAttributes attributes}}} </row> {{/xlsxAdd}} {{/each}}
The outputCustomAttributes JS function is an exact copy of the code that happens within the #each above.
I will try to work up a playground example with fake Data that can show a working example of the difference in performance.
-
RE: Nested Each slow performing
I should also mention that I am still on 3.11.3, but hope to move to 3.13 soon. I am just having some issue with our Docker and permissions on the new version of Node
-
Nested Each slow performing
We have a report that is building data in to an Excel file. The data is about 28MB, so it's a large amount of records. Some of those records have nested data. If we do an #each in handlebars and then nest another #each underneath it, it is SIGNIFICANTLY slower than if we create a JS function called {{{ CreateLookupColumns }}} and pass in that data and have it build the records and return a single string back. I am wondering if there are known performance issue with nesting #each statements because of context switching and if as a standard practice we should avoid the nested construct with large data sets.
Unfortunately I cannot publicly post this example, but if you need to see a working example, I can show you where it takes 45+seconds when using nested each statements and 9 seconds when it's using the single JS function call that does the exact same code. We have narrowed everything down to it being the nested Each statement that is the issue and i can only think of the context switching as being the slowness.
Just trying to understand the recommended way that we should build the reports as it works correctly both ways, just seems to be a lot slower one way over the other.
-Thanks
-
RE: Uncommitted Changes
I emailed you the whole folder compressed so you can see what's running. It came from my other email so i could share a large file with you, but i put this forum in the subject