I am using the Reports module to update a pdf report every hour. I am also using a Perspective page with a button to open the pdf file which is stored in the Web Dev module. I want the Web Dev to update the file automatically when the Report module generates a new report. Can we do that?
You could browse every file in your folder and get the lastest report path. Then return the file with the following code in the webdev python ressourse GET.
Are you overwriting an existing file in a certain directory, or saving with different timestamps?
Do you actually need to save these files in a directory, or can your Webdev endpoint just generate the report programatically?
Currently, I am overwriting the report every hour. I thought that Web Dev would update to the newest version but it doesn’t. I need the report to be saved in a pdf format and opened in a new tab when I press on a certain button in Perspective View.
I am not generating the Web Dev programmatically, although I tried but failed.
Use a mounted folder resource type, not a file. File resources are copied into the project, so they’re static once configured. A mounted folder is ‘dumb’ - it will always attempt to retrieve whatever path it’s given.
I mount the folder (the folder is on the network not on my local device but the gateway has access to that folder because I can post the report on that folder)
Right click on the button --> Configure Event --> Mouse Event on Click --> Add Navigation --> Url --> paste the mounted path of the folder/myfile
The path in the bytesArray is the path to the report INSIDE the project.
So if it is in the reports folder as Report1 then in the bytesArray it would be “Report1”
If it’s in a folder under Reports then it would be “FolderName/Report1”