@jan_blaha How can I add those Files to my JsReport Instance? I tried by copying them on the FileSystem but I got only empty folders in the studio. Do I need to use OData?
Marsturix
@Marsturix
Posts made by Marsturix
-
RE: Access Ressources from Helper Functions of docx
-
Conditional PageBreaks in Docx
Is there an in-built Possibility to only do PageBreaks on certain conditions with the Docx Recipe or would I need to build my own Helper Method around this?
What I currently have is something that looks simplified like this:
{{#each objects}} {{template of object}} {{docxPageBreak}} {{/each}}
Since this at the End of the Report the last Page is just an empty Page which is not nice.
-
RE: Access Ressources from Helper Functions of docx
@jan_blaha do you need any further information like jsreport version or similair?
Also I suppose since you're now aware of it I don't need to report a github issue, right? -
Access Ressources from Helper Functions of docx
Hi there
I'm currently developing a Report with Docx as the Template Recipe, that I want to be Localized.
Accessing the ressource Data in the docx itself works as expected. However when trying to access the local ressource in the Helper with
this
I get an undefined Error.When looking at the logs it looks to me as if the resource data is not copied from the Main render process to this sub Process where apparently the Helper functions get rendered
Ps: not really sure on which version of jsReport I currently am how can I check this? as this seems important information to me.
Console Output :
2021-10-11T08:21:35.640Z - info: Starting rendering request 217 (user: null) 2021-10-11T08:21:35.641Z - info: Rendering template { name: DocxTest, recipe: docx, engine: handlebars, preview: true } 2021-10-11T08:21:35.644Z - debug: Adding sample data eIdvbN9ACS 2021-10-11T08:21:35.645Z - debug: Found 1 resources for language "de" <------- 2021-10-11T08:21:35.645Z - debug: Base url not specified, skipping its injection. 2021-10-11T08:21:35.646Z - debug: Rendering engine handlebars using http-server strategy 2021-10-11T08:21:35.651Z - debug: Taking compiled template from engine cache 2021-10-11T08:21:35.652Z - debug: Executing recipe docx 2021-10-11T08:21:35.652Z - info: docx generation is starting 2021-10-11T08:21:35.755Z - debug: Starting child request to render docx dynamic parts 2021-10-11T08:21:35.756Z - info: Starting rendering request 218 (user: null) 2021-10-11T08:21:35.756Z - info: Rendering anonymous template { recipe: html, engine: handlebars } 2021-10-11T08:21:35.757Z - debug: Inline data specified. 2021-10-11T08:21:35.757Z - debug: Resources not defined for this template. <----- 2021-10-11T08:21:35.757Z - debug: Base url not specified, skipping its injection. 2021-10-11T08:21:35.759Z - debug: Rendering engine handlebars using http-server strategy 2021-10-11T08:21:35.771Z - debug: Taking compiled template from engine cache 2021-10-11T08:21:35.772Z - debug: this: 2021-10-11T08:21:35.772Z - debug: { test: 'this is a test' } <------ print of this object 2021-10-11T08:21:35.776Z - debug: Executing recipe html 2021-10-11T08:21:35.776Z - info: Rendering request 218 finished in 20 ms 2021-10-11T08:21:35.776Z - debug: Skipping storing report. 2021-10-11T08:21:35.892Z - debug: docx successfully zipped 2021-10-11T08:21:35.892Z - info: docx generation was finished
-
RE: Parse Error with docximage when getting src with #asset
@bjrmatos Ah thank you. With
{{docxImage src="{#asset test2.jpg @encoding=dataURI}" }}
it worked.could I have found this in the documentation somewhere?
-
Parse Error with docximage when getting src with #asset
I'm trying to get an Image from Assets into my docx Templated report therefor I'm using the following Tags on the image link:
{{docxImage src={#asset test2.jpg @encoding=dataURI}}}
However this results in some strange parsing Error:Error: Error while executing docx recipe. Error while executing templating engine. Parse error on line 5: ...mage src=data:image/jpeg;base64,/9j/4AAQ -----------------------^ Expecting 'ID', got 'INVALID' at module.exports (D:\gitProjects\jsreport\node_modules\jsreport-core\lib\util\createError.js:11:13) at Reporter.createError (D:\gitProjects\jsreport\node_modules\jsreport-core\lib\reporter.js:332:12) at Object.execute (D:\gitProjects\jsreport\node_modules\jsreport-docx\lib\recipe.js:58:20) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async module.exports (D:\gitProjects\jsreport\node_modules\jsreport-core\lib\render\render.js:150:5) caused by: Error: Error while executing templating engine. Parse error on line 5: ...mage src=data:image/jpeg;base64,/9j/4AAQ -----------------------^ Expecting 'ID', got 'INVALID' at Object.callbackRequests.<computed> (D:\gitProjects\jsreport\node_modules\script-manager\lib\worker-servers.js:250:31) at process.<anonymous> (D:\gitProjects\jsreport\node_modules\script-manager\lib\worker-servers.js:195:30) at process.emit (events.js:412:35) at process.emit (domain.js:470:12) at emit (internal/child_process.js:910:12) at processTicksAndRejections (internal/process/task_queues.js:83:21)
-
Getting Html Documents instead of docx when calling proxy.render on docx Template
When I call to render a docx Template from a Script instead of the actual docx Document I get a Html as return value whit a link to the Word Preview on Microsoft Office Online service(?)
How can I change that to get the actual docx document?const jsreport = require('jsreport-proxy') async function afterRender(req, res) { // do some stuff before let options = { "reports": { "save": true }, } const rendered = await jsreport.render({ template: { name: 'myDocxTemplate' }, data: data, options: options }) //do some stuff after
Response Html:
<html><head><title>myDocxTemplate</title><body><iframe style="height:100%;width:100%" src="https://view.officeapps.live.com/op/view.aspx?src=http%3A%2F%2Fjsreport.net%2Ftemp%someCripticId.docx" /></body></html>
-
RE: Is it possible to create multiple docx File (serial letter)
@bjrmatos Ah ok I was mainly wondering because in my IDE it told me to install the module using npm but couldn't find it... so I thought it must be jsreport directly since that installation worked. I guess that warning or Info should be just ignored then.
-
RE: Is it possible to create multiple docx File (serial letter)
@jan_blaha Is it possible to call such a script directly without an corresponding Template?
I'm asking, because I've build up my script creating several reports of TemplateB and attached that one to a TemplateA
However TemplateA is basically empty and unneccessary and only there so the script can be executed.
-
RE: Is it possible to create multiple docx File (serial letter)
@jan_blaha thx for the information looking into it and trying it out
Why did you
require('jsreport-proxy')
though? shouldn't that berequire('jsreport')
?