Scheduling - Run Script
The Run Script action is a scripting event that executes based on the schedule. This action does not inherently email, save, or otherwise distribute a report unless you do so in the script. However you can easily use system.report.executeAndDistribute() to send out the report.
Example
The following would insert a copy of the report into a database table, and then save the report on the gateway's desktop as a PNG
Run Script example
#save a copy of the report
query
=
"INSERT INTO report_log (name, data) VALUES (?,?)"
system.db.runPrepUpdate(query, [reportName,reportBytes])
#distribute the report
system.report.executeAndDistribute(path
=
'my report'
, project
=
'my project'
,action
=
'save'
, actionSettings
=
{
'path'
:
'C:\\Users\\User\\Desktop'
,
'fileName'
:
'SavedReport.png'
,
'format'
:'
'png'
})
On this page...