You can use assets to reuse code between scripts.
https://jsreport.net/learn/assets#require-asset
Jan Blaha
@admin
Posts made by admin
-
RE: How can I use one script inside another script?
-
RE: Using Handlebars `@ index` inside a component
I'm not sure how to fix it. It is too abstract. However the problem is the following...
async function componentWrapper(name, opts) { // here you let evaluate the `Number: {{1}}` code, but the `#each` haven't even started const childValue = await jsreport.templatingEngines.waitForAsyncHelper(opts.fn(this)) // here you invoke `Footer` component with each return component.call({ ...opts.data, child: childValue }, name, opts) }
-
RE: Using jsreport/jsreport:4.8.0 and html-to-xlsx recipe ends always in timeout Error: script evaluation not completed after...
You need to add the following env because of the chrome update
docker run -p 5488:5488 -e "chrome_launchOptions_args=--no-sandbox, --disable-dev-shm-usage, --disable-gpu" jsreport/jsreport:4.8.0
-
RE: Timeout Issue When Generating Large PDFs (On-Premise, Enterprise License)
Hm, I still think there must be some kind of network infrastructure that interrupts the request when it doesn't send a response in 30s....
What if you try a template that waits 40s, like a template with this in the helpers
await new Promise((resolve) => setTimeout(resolve, 40000)
Does that fail on the same error?
If yes, then can you try to install jsreport on your local and try to render it locally, does that fail as well?
-
RE: Increase rendering time in same short template on Windows and got 0kb when receive the ETIMEDOUT error
Unfortunately, I have even no theory why windows security patch breaks things.
-
RE: Differences in PDF generated by Docker Image 4.7.0 and 4.7.0-full
This is likely because the full image has additinal fonts installed. Try to create an image like this from the default one. This should add text to the svg when converting the jsreport sample invoice template.
FROM jsreport/jsreport:4.7.0 RUN set -x \ && apk add --no-cache \ font-terminus font-inconsolata font-dejavu font-noto font-noto-cjk font-awesome font-noto-extra
-
RE: Increase rendering time in same short template on Windows and got 0kb when receive the ETIMEDOUT error
Ah ok, this is the IP address where jsreport uploads the office files for preview. However this is happening only when you run the preview request and display the output in the office live browser's app. jsreport isn't reaching this ip in other cases. Also it never goes to the port 90 where nothing is running. So that is very strange.
I can imagine that the security patch breaks some kind of networking. However maybe there is a jsreport bug that you just didn't notice. jsreport 2.4.0 is 6years old. Perhaps you can update jsreport. At least to jsreport 2.11.0 which shouldn't have breaking changes.
-
RE: jsreport Error when trying to run the pdf
You are using the following absolute path to reference an asset
/TS130/IT/Master/DdT/Sales/helpers.js
However the correct path is
/REVISO/TS130/IT/Master/DdT/Sales/helpers.js
Or you can use relative paths to the template
./helpers.js
-
RE: Increase rendering time in same short template on Windows and got 0kb when receive the ETIMEDOUT error
Could you tell me what is the ip/port mentioned in the error? 68.219.241.39:80
Could you try to change the configs
extensions.scripts.strategy="dedicated-process"
andtemplatingEngines.strategy="dedicated-process"
-
RE: Issue with Memory Consumption and OOM Errors When Using docxImage with Base64 Images
I noticed that the same issue is occurring in the docxHtml helper
I've updated the task
Also, do you have an estimated timeframe for when this might be picked up?
We have currently long queue with
docx
recipes task. It can take a month to get to this I guess.