Configure what path reports are saved to



  • Hi

    We have recently upgraded our jsreport from version 2.11.0 to the latest version.
    I have seen that the path in which reports have saved have changed. We are using azure for our blob storage.

    In 2.11.0 the rendered report was just saved into the root directory of the container.
    In the latest version it mimics the folder structure of jsreport.

    Is there anyway that I can configure this? It will save some development on our application

    Thanks for the help



  • I have tried to add the data directory to the config file like so:

    0_1709535137482_upload-58b28f1f-fe7c-463c-8d80-419e780e81fa

    however it still does not save to just the reports directory.



  • You can implement jsreport custom script that will customize the path
    https://jsreport.net/learn/scripts

    async function afterRender (req, res) {
        if (res.meta.reportsOptions) {
            res.meta.reportsOptions.blobName = "myreport" + new Date().getTime()       
        } 
    }
    

    You can give it a global scope so you won't need to add it to every template.



  • Awesome thank you very much, working perfectly.


Log in to reply
 

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