Contents
Strategic Partner Links
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
SDK Examples
Executes and distributes a report. Similar to scheduling a report to execute, except a schedule in not required to utilize this function. This is a great way to distribute the report on demand from a client.
The function system.report.executeAndDistribute() does not run on its own thread and can get blocked. For example, if a printer is backed up and it takes a while to finish the request made by this function, the script will block the execution of other things on that thread until it finishes. Be sure to keep this in mind when using it in a script.
This scripting function has no Client Permission restrictions.
This function accepts keyword arguments.
system.report.executeAndDistribute(path, project, [parameters], action, [actionSettings])
String path - The path to the existing report.
String project - The name of the project where the report is located. Optional in client scope.
PyDictionary parameters - A optional dictionary of parameter overrides, in the form name:value.
String action - The name of the distribution action to use. The action parameter supports the following keys as strings:
PyDictionary actionSettings - An optional dictionary of settings particular to the action. Missing values will use the default value for that action.
None
IllegalArgumentException - Thrown when any of the following occurs: If the file type is not recognized, path does not exist, project does not exist, or a key is not valid.
All
The action settings parameter supports an optional dictionary of settings particular to the action. Missing values will use the default value for that action.
The email action now has the ability to add emails to the reply to field of the email. The replyTo, replyToRoles, and replyToUserSource keys have been added to the possible dictionary options.
The following is a list of values for the actionSettings filetype and format keys.
# Executes and distributes the report to an email address. system.report.executeAndDistribute(path="My Report Path", project="My Project", action= "email", actionSettings = {"to":["plantmanager@myplant.com"], "smtpServerName":"myplantMailServer", "from":"reporting@myplant.com", "subject":"Production Report"})
# Executes and distributes the report to all users in the default user source who are Supervisors or Managers. system.report.executeAndDistribute(path="My Report Path", project="My Project", action= "email", actionSettings = {"useRoles":True, "roles":["Supervisor", "Manager"], "smtpServerName":"myplantMailServer", "from":"reporting@myplant.com", "subject":"Production Report"})
# Executes and distributes the report to an ftp server with parameter values passed into the report reportParameters = {"startDate":system.date.addHours(system.date.now(), -12), "endDate":system.date.now()} settings = {"server":"10.20.1.80", "port":22, "username":"Ignition", "password":"Secret", "useSSL": False, "path":"C:\\FTP", "fileName":"Ignition Report", "format":"pdf"} system.report.executeAndDistribute(path="My Report Path", project="My Project", parameters=reportParameters, action= "ftp", actionSettings = settings)
# Executes and distributes the report to save a PDF settings = {"path":"C:\\Ignition Reports", "fileName":"Report.pdf", "format":"pdf"} system.report.executeAndDistribute(path="My Report Path", project="My Project", action="save", actionSettings=settings)