aws-s3-storage for report with out API call



  • I can store my xlsx file by API call as follows:
    POST http://xx.xx.xx.xxx:8443/api/report

    {
          "template": { "shortid" : "2F44QoE" },      
          "options": {
              "reports": { "save": true, "blobName": "dailyrpta/myfilename3" }
          }
       } 
    

    But, I need to do this in the script with the template because I have to scedule to run daily, I have tried the following, even this is working with the API call only.

    async function beforeRender(req, res) {   
        if (res.meta.reportsOptions) {
            res.meta.reportsOptions.blobName = "dailyrpta/daily_report" + new Date().getTime()   
        }
    }
    

    I think I am missing only this part "reports": { "save": true, ) in the script.
    Please let me know if you have any idea.



  • Your intention is to customize the blob name in the script right?

    We have a bit old backlog item for this, please check it out and let me know if that helps.
    https://github.com/jsreport/jsreport/issues/789



  • I am having this script already.
    The issue is, report is not stored to s3 while running through studio or schedules.

    It is storing or going s3 while I am running through API with following:
    POST http://xx.xx.xx.xxx:8443/api/report
    {
    "template": { "shortid" : "2F44QoE" },
    "options": {
    "reports": { "save": true }
    }
    }

    Just I need to bring this to the script.



  • The issue is, report is not stored to s3 while running through studio or schedules.

    The schedules should store reports to the defined blob storage.

    The studio doesn't and you can't change this with the script. It runs later in the pipeline.

    You could require a aws-s3 nodejs lib and upload there on your own in script, without using jsreport reports extension.



  • "The studio doesn't"
    I was confused by this.

    By schedule it works! Thanks..


Log in to reply
 

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