Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


 

Scheduling Actions

There can be any number of actions associated with a Schedule from storing, distributing, or notifying users upon completion of a report.  Each

Actions can be configured to run once the report has generated at the scheduled time. Each action has its own custom configuration interface to make adding and editing Actions simple. The Actions you can perform following report generation are Print, FTP, Save, Email, and Run Script. You can

also

even have multiple actions on the same schedule

, so in addition to a Save File Action, click the plus icon again and select  any one of the other Actions (i.e., Print, FTP, Email, or Run Script).

 The following image is an example of a scheduled Email Action.  

Image Removed
Before we get started, here are a couple of functions common to all Actions. It is important to note, that before you add any

. So you can save the report to the hard drive, as well as email it out to multiple users.

Before creating any Scheduling Actions, you must first

add Schedule

 

FunctionsDescription
Image RemovedSelect the Print Action.
Image Removed Run the selected Action immediately.
Image Removed Delete the selected Action.

Print Action

Print File is often used to create hard copies of reports automatically when the report is generated.

To create an Action, click the Actions tab, click the plus icon Image Added and select an Action. Actions can be deleted using the trash can button Image Added, and executed immediately using the double arrow buttonImage Added.

 Image Added


On_this_page

 


 

 

Print Action

The Print Action is used to send a report to a printer that is accessible from a computer Ignition is installed on. To configure the Print Action, select a schedule and set the following configuration settings as appropriate:

  • Add New Action - click the plus icon Image Removed and select New Print Action.
  • Primary Printer - select your primary printer from the dropdown list.
  • Backup Printer - select a backup printer from the dropdown list (optional).
  • Print Mode - select from either Vector or Raster file format.Vector - uses

     Here are a list of property descriptions for the Print Action.

    Property NameDescription
    Primary PrinterThe primary method of printing the report.
    Backup PrinterA backup method of printing the report. Will print using this option if the Primary Printer fails. [Optional]
    Print Mode

    The mode to print the report in. Can be either Vector or Raster.

    Expand
    titlePrint Modes


    Print ModeDescription
    VectorUses math to draw shapes using points, lines, and curves.The most common types of vector graphics are fonts and logos.  PDF is a popular vector type. Vector based graphics like SVG image files show images with no pixelation when the size is changed.
     
    Raster
     - are
    Are composed of thousands of pixels or dots. Set the dpi (dots per inch). Common raster file format extensions are jpg, jpeg, png, tiff, bmp, and gif.
     



    Copies
    -
    The number of copies
    to send to the printer.Options - print options
    of the report that will print.
    Print on both sides
    of
    Will attempt to print on both sides of a sheet of paper, if supported by the printer.
    Collate
    - order or arrange pages
    Orders the pages so that a complete report prints before the next copy prints, if applicable.
    Use AutoLandscape Mode
    - evaluates
    Evaluates the page dimensions and determines portrait or landscape orientation.
    Page Orientation
    - Portrait or Landscape You can also Print the report immediately by selecting the Print Action and pressing the double arrow icon Image Removed.
    The orientation of the page. Can either be Portrait or Landscape.



    FTP Action

    The FTP Action can  can be used to automatically upload your reports to a file server for backups or storage. To configure the FTP Action, select a schedule and set the following configuration settings as appropriate. 

  • Add New Action - click the plus icon Image Removed and select New FTP Action.
  • Server Address - specify a server address.
  • Port - specify what port to use.
  • Folder Path - enter the folder path where the file should be uploaded to. 
  • Format - choose the file format from the dropdown list that you want to save the report to.                                                                  
  • Username and Password - enter the user credentials that Ignition should be using

    Here are a list of property descriptions for the FTP Action. 

    Property NameDescription
    Server AddressThe server address where the report file will be transferred.
    PortThe port of the file transfer.
    Folder PathThe folder path that the report file will be transferred to.
    FormatThe file format of the report.
    UsernameThe username that will be used to access the FTP server.
  • SSL - mark 'true' if using an encrypted link.
  • Filename - by default, your Report Name
    PasswordThe password that will be used
    as the filename, but you can change it. You can even use any of the Operators, Functions, Parameters or Tags to help you create your filename.  

    You can also FTP the report immediately by selecting the FTP Action and pressing the double arrow icon Image Removed.

    Image Removed
    to access the FTP server.
    SSLWill use SSL encryption if True.
    FilenameThe name of the report file. The Filename property is constructed using the expression language.


    Image Added

     

    Save File Action

    The Save File Action will save a copy of the report to any folder the Ignition computer server has access to, locally such as a local folder or network shared drive. If a report is saved as HTML, it will output both <report>.html and an images folder containing a .png of the report. Both parts need to be present to view the report properly.  To configure the Save File Action, select a schedule and set the following configuration settings as appropriate. 

    • Add New Action - click the plus icon Image Removed and select New Save File Action.
    • Folder Path - specify a folder path.
    • Format - choose the file format from the dropdown list that you want to save the report to.
    • Filename - by default, your Report Name will be used as the filename. You'll notice that the expression is already built for the filename, but you can change it. You can also use any of your Parameters or Tags which you'll find on the right side of the Save File Action window. 

    You can Save the file immediately by selecting the Save File Action and pressing the double arrow icon Image RemovedHere are a list of property descriptions for the Save File Action.

    Property NameDescription
    Folder PathThe folder path to save the report files to. This folder path is for the Ignition Gateway server.
    FormatThe file format of the report.
    FilenameThe name of the report files. The Filename property is constructed using the expression language.



    Scroll HTML Exporter Ignore


    Iulink
    URLhttps://www.inductiveuniversity.com/video/scheduling-actions-save
    NameScheduling Actions - Save

     



     

     

    Email Action

    The Email Action distributes a report via email when the report is finished executing. There is a Recipients Source property that allows you to send emails using either Email Addresses or User Roles. The 'From Address,' 'Subject', 'Body,' and 'Attachment Filename' are all configurable. The Subject, Filename, and Body editors can utilize Expressions to dynamically add content or change names.

    Email Server settings must first be configured on the Gateway webpage under Configure > Networking > Email Settings page, or in Email Actions and clicking the Create new server link. Once you create and save an SMTP profile, you can test your email settings for your mail server on the Gateway webpage under Email Settings.

    To configure an Email Action, select a schedule and set the following configuration settings as appropriate. 

  • Add New Action - click the plus icon Image Removed and select New Email Action.
  • From Address - enter the sender's address.
  • Mail Server - specify a mail server from the dropdown list


    Scroll HTML Exporter Ignore


    Iulink
    URLhttps://www.inductiveuniversity.com/video/scheduling-actions-email
    NameScheduling Actions - Email

     




    Info
    titleCreating an email server

    Before you setup any reports to be emailed, an email server must be configured. To create an email server if one doesn't exist, use the 'Create new server' link. This link will take you to Configure > Email Settings on the Gateway webpage. There, you will be able to create an SMTP server. For more information, refer to Gateway Settings.

    Here are a list of property descriptions for the Email Action.

    Property NameDescription
    From AddressThe Email address from which the report is sent from.
    Mail ServerThe mail server to use to email the report. If one doesn't exist, click on
    the
    the Create new server
    link
     link.
    The
    Refer to Email Settings
    page under the Configure section of the Gateway webpage will open.  Here you can create an SMTP profile for your mail server. 
  • Format - choose the file format from the dropdown list that you want to save the report to.
  • Retries - enter the number of retry attempts in case of a failure.
  • Recipients Source - There are two types of Recipients Source: Email Addresses and User Roles, each having a different interface. Enter one Recipients Source.Email AddressesRecipient Emails - enter recipients email addresses. To add multiple address, click the plus icon
     for more information on that page.
    FormatThe file format of the report.
    RetriesThe number of retry attempts if the email that was sent failed to be delivered the first time.
    Address Source

    Will decide how email addresses are collected. Can be either Email Addresses or User Roles.

    Info


    New_in
    Version7.9.8


    There is a new 'ReplyTo' Email function that allows you to reply to email actions using the Email Address and User Roles. This simply adds those emails to the "ReplyTo" header of the email sent to the recipient list, so that if recipients choose to reply to that email, their reply is sent to those email addresses as well. 


    Expand
    titleEmail Addresses

    A table of email addresses with a method that determines how those addresses will be used. Click the plus icon Image Modified on the right side of the window to add additional rows.

     
  • Method - specify 'To,' 'CC,' or 'BCC,' as appropriate.
  • User Roles
    • User Source - select user source from the dropdown list.
    • Recipient Roles - enter user roles. This sends out reports to all users in the specified roles. If this field is left blank, an email will be sent to users in all configured roles. 
  • You can Email the file immediately by selecting the Email Action and pressing the double arrow icon Image Removed.

    Recipients Source - Email AddressesImage Removed

    Recipients Source - User Roles
    Image Removed
    Scroll HTML Exporter Ignore

    Iulink
    URLhttps://www.inductiveuniversity.com/video/scheduling-actions-email
    NameScheduling Actions - Email

     

    Run Script

    Property NameDescription
    AddressesA list of email addresses.
    MethodThe corresponding method of what to do with the email addresses. Options are To, CC, BCC, and ReplyTo.



    Expand
    titleUser Roles

    A list of roles where anyone with the given role in the specified user source with an email address will receive an email.

    Property NameDescription
    Recipient User SourceThe User Source to pull users from that match the Recipient Roles to get an email.
    Recipient RolesA list of roles to match with users. Any user that has any of the listed roles will get an email.
    ReplyTo User SourceThe User Source to pull users from that match the ReplyTo Roles that will be listed in the reply to of the email.
    ReplyTo RolesA list of roles to match with users. Any user that has any of the listed roles will have their email listed in the reply to of the email that gets sent out.



    SubjectThe subject of the Email. The Subject property is constructed using the expression language.
    Attachment FilenameThe name of the attached report. The Attachment Filename property is constructed using the expression language.
    BodyThe body of the email. The Body property is constructed using the expression language.

    Configuring an Email Action

    1. In the Schedule panel, create a Schedule to automatically email a report by clicking on the plus icon Image Added, if you don't already have one.  
    2. Next, click on the Actions tab.
    3. Click on the plus icon Image Added, and select the New Email Action from the dropdown list.
    4. Enter the sender's email address in the From Address field. 
    5. Select the Mail Server from the dropdown list.  If one does not exist, click the 'Create new server' link to create one. 
    6. Select the Format from the dropdown list.
    7. Enter the number of Retry attempts in the event the email failed to be delivered the first time.
    8. You can send emails to users using either Email Addresses or User Roles. Under Address Source enter either Email Addresses or User Roles
      Note, email recipients can choose to reply to the email if they prefer, since the email address is added to the 'Reply To" header of the email.
      1. Email Addresses - enter individual email addresses under in the Recipient and ReplyTo Emails area. To add multiple addresses, click the plus icon Image Added on the right side of the window. Next, specify the Method of how to send the email: To, CC, BCC, or ReplyTo
      2. User Roles - select the User Source from the dropdown in the Recipient User Source field.  
        1. In the Recipient Roles field, begin typing a configured role and Ignition will validate it. 
        2. In the Reply to User Source, select the User Source from the dropdown. (Optional)
        3. In the RepyTo Roles field, enter the role(s) you want listed in the 'ReplyTo' header of the email. (Optional)
    9. Enter in values for the SubjectAttachment Filename, and Body fields, or use the defaults.

    Recipients and ReplyTo Emails

    Image Added

    Recipients Source - User Roles

    Image Added


    Run Script Action

    This Run Script Action allows you to store your report in a database, provide special email code, or anything else you can think of. Run Script exposes the function handleFinishedReport() which gives you the report name and path, a mapping of the report parameters and datasets, and the bytes in whatever format you want. To configure an Run Script Action, select a schedule, create your script, and set the following configuration settings as appropriate. 

    • Add New Action - click the plus icon Image Removed and select New Run Script Action.
    • Run Script - enter your script.
    • Format - choose the file format from the dropdown list that you want to save the report to.

    You can Run the script immediately by selecting the Run Script Action and pressing the double arrow icon Image Removed.

    Image Removed

     

     

     

     

    Here are a list of property descriptions for the Run Script Action.

    Property NameProperty Description
    Run ScriptAn area where a script can be created to do something at the scheduled time.
    FormatThe file format that the reportBytes parameter should be.



    Scroll HTML Exporter Ignore


    Iulink
    URLhttps://inductiveuniversity.com/video/scheduling-run-script
    NameScheduling - Run Script

     



    Image Added

    Arguments

    The handleFinishedReport function has the following arguments:

    • String reportName The name of the report for which this script should run.
    • String reportPath - The path to the report in your project.
    • PyDictionary dataMap - The Python Dictionary containing the Parameters and Data Sources that were supplied to the report. This argument allows you to directly access Parameters and Data Sources in the report. Note that once handleFinishedReport() has been called, the report has already been generated, so changing the parameters from this function will not alter the resulting report. Instead, parameters should be altered from the Parameters tab. 
    • byte[] reportBytes - The report, presented in a byte array. The format of the report depends on the format specified in the Format dropdown list. 

    The dataMap Argument

    There is a special argument  in the RunScript Action called dataMap that may be used to review the raw data that was used to generate the report. Below is a demonstration of using dataMap.

    Code Block
    languagepy
    titleUsing dataMap
    # The dataMap argument is simply a Python Dictionary with the name of each Parameter and Data Source acting as a key.
    
    # Assuming a Report Parameter named 'shift', the value of 'shift' may be accessed with the following
    dataMap['shift']
    
    # Similar syntax may be used to extract the value from a Data Source. 
    data = dataMap['myDataSource']
    
    # Rows objects, while similar in nature to a dictionary, are different objects.
    
    # Individual rows in the Data Source may be accessed by index.
    firstRow = data[0]
    
    # getKeys() may be called on a row to list all of the column headers in the row. 
    firstHeader = firstRow.getKeys()[0]
    
    # getKeyValue() may be used to access the value of a column in the row.
    firstColumnInRow = firstRow.getKeyValue(firstHeader)