Hey
I am using jsreport-core in node with jsreport-scheduling extension. My application has fs configured for jsreport.
I am facing issues when my node server stops and restarts after some time. My schedule also gets created itself but it runs multiple times.
For example : If my schedule is configured to run every 10 minutes and my server was down for 60 mins then on restart my schedule runs 6 times.
How can i prevent this from happening?
gupta-nitish
@gupta-nitish
Posts made by gupta-nitish
-
Schedule creates multiple reports after jsreport server restart
-
RE: ReferenceError: jsreport is not defined
Hey! I am facing the same issue.
I Tried using both html and html-with-browser-client recipe with browser-sdk script included in template but i still get the same error that js report is not defined.
I am running a node application that generates a report using jsreport.render function and returns that report to the client where it gets binded inside a div. -
RE: Using html-with-browser-client to render report through node.
Hi @bjrmatos .Thanks for the quick reply.
Actually when we tested the same in jsreport studio, it worked fine for us. Hence we are sharing the code snippet instead of creating a template on playground.
We are using the below method to generate the report and return it to client to display on web :return this._jsreport.render({ template: { content: this.template(args.recipe), helpers: this._helper, engine: "handlebars", recipe: "html-with-browser-client", scripts: this.scripts(), resources: { items: dataIds, defaultLanguage: defaultLanguage } }, data: { reportName: this._name, reportDisplayName: this._displayName, scheduleType: "generate", filters: JSON.stringify(args.filters), recipe: args.recipe }, options: { language: args.language } })
If a template is required, we will create a template at playground and share the link.
-
Using html-with-browser-client to render report through node.
Hi,
I am trying to generate a report through node using jsreport package and html-with-browser-client recipe. But i am getting an error saying "Cannot read property baseUrl of undefined".
I am using jsreport.generate() to generate my report and return the response to UI.
I also tried setting jsreport.serverUrl but this did not help.Kindly let me know what i am missing.
Thanks.
-
Not able to generate reports with 2 million rows and filesize > 80MB.
Hi,
We are trying to create a report with text recipe and handlebars engine with around 2 million rows. We make a rpc call in the beforeRender function to fetch the data and the request returns the data in around one minute.
But then the report is never generated and our afterRender function is never called.
The report gets generated successfully sometimes in around 3 minutes but most of the times the execution gets stalled in between the two scripts.Below is our code for beforeRender script :-
dmLog.info(`starting before render script for : ${req.data}.`); //database query to fetch data rows for report. return getData() .then((result) => { dmLog.info("got data"); req.data["values"] = result; dmLog.info("data processed"); done(); }) .catch((e) => { dmLog.error("Error in before render script for Wifi Read Report."); dmLog.error(e); req.data["error"] = true; done(); }); }
And this is for afterRender scipt :-
dmLog.info("reached after render"); //saving generated report into filesystem. saveReport(req.data, res, done) .then((x) => { dmLog.info(`afterRender for save completed for data ${req.data}- `); done(); }) .catch((x) => { dmLog.info(`afterRender for save is failed for data ${req.data}- `); done(); }); } }
We have set the timeout in our config for both scripts.timeout and templatingEngines.timeout to 10 minutes.
We are able to generate report with around 1.7 million rows successfully but faced issues with 2 million.
Can you suggest what we can do in order to prevent this stalling?
-
Add jsreport in dev-dependency while using jsreport -core in dependency
Hi,
We are using jsreport-core in our project and want to use jsreport package for development using jsreport studio. So we have added jsreport-core as a dependency and jsreport as a dev-dependency.
While trying to start jsreport server with 'jsreport' package as a dev dependency, it keeps picking jsreport-core to start the server instead of the jsreport package and it also fails to use the extensions and the configuration provided in jsreport.config.json.
Below are the logs for the above :>resolving jsreport location.. >no entry point was found, creating a default instance using: require("jsreport-core")() >starting jsreport.. >jsreport successfully started
If we add jsreport as a normal dependency or remove jsreport-core from our dependencies, it works fine.
How can we avoid this and use jsreport package to start the server instead?Thanks in advance.
-
jsreport-scheduling in node.js
Hi, I am trying to implement a scheduler to periodically email reports generated through jsreport.
I want to implement a jsreport-scheduler in node.js without using jsreport-studio.
I am using jsreport-core with jsreport-scheduling extension but have not been able to find a way to do it without using the studio.
Is there a way to do this?
Any help will be appreciated.Thanks.