Save data to custom request blob storage location
-
Hi all,
I want to be a setup a pdf rendering service that will serve for multiple customers. Ideally I would want the output pdf to be stored in a storage account, specified upon request (assuming we have all the permissions sorted out).
From the documentation, I can only find a way to configure the account settings beforehand.
Is there a way to do this?Bonus question: I would like to get the input data for the same request from a specific blob location as well, the location of the file and storage account info will be provided in the request instead of the data.
I figure we could do something similar to what is explained here: https://jsreport.net/blog/pdf-reports-in-sql-server#prepare-input-data-source, but instead of retrieving the input data from sql, we would get it from a blob store.Maybe pushing the output data to a blob store can be done in a similar way, using an afterRender function?
Thanks in advance, Elvin
-
I would want the output pdf to be stored in a storage account, specified upon request (assuming we have all the permissions sorted out).
The custom jsreport scripts hook
afterRender
is there to give you the option to upload the results somewhere.
https://jsreport.net/learn/scriptsThe example in the documentation sends the output through email and you just need to change the script code to upload it as a blob to your storage.
I would like to get the input data for the same request from a specific blob location as well, the location of the file and storage account info will be provided in the request instead of the data.
Yes, this is the common flow as well. You can use
beforeRender
hook and actively download the input data from your services. It can be from blob, REST, database... There is no limitation and it is just up to you how you implement the hook body.