Files are automatically gets deleted while refresh the jsreport studio in local machine



  • Files are automatically gets deleted while refresh the jsreport studio in local machine.
    Here i integrated the jsreport with my nodejs application.The jsreport runs on localhost:3000 and my node application is run on localhost:9000. When i start the nodejs application, the jsreport will start automatically. Here the problem is when i restart the node application, the templates in Jsreport gets deleted. I have to create newly for each time when i restart the node server. Why it is happening?



  • If you don't provide any config file or connection string to jsreport, it will use the memory store. See here how to use the fs store and persist the templates
    https://jsreport.net/learn/configuration



  • It would be probably easier for you to start jsreport as standalone application. Play with it to understand how it works and then integrate it directly to the node.js app. The most of the docs expect you run it as standalone app so it would be for you more understandable.

    For example the default config file created for the standalone jsreport includes:

    "connectionString": { "name": "fs" }
    

    This tells jsreport to persist templates to the disk. If you run require jsreport directly to your node.js application and don't have the configuration file in place, you can easily pass this config to the jsreport "constructor" as any other config mentioned in the docs

    require('jsreport')({ .... "connectionString": { "name": "fs" } ... }).init()..
    

    Hope this makes sense



  • thank you very much


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.