> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-reporting/schedule.md).

# Schedule, email and FTP reports

Schedule DATRAN Reporting reports to run automatically, and set up email and FTP delivery, including TLS 1.2 mail servers such as Office 365.

Reporting runs as a Windows service so that reports are generated without being logged in. The DATRAN Reporting Service is a Windows Service that handles the timed scheduling of report creation and distribution via email, FTP etc. A report can be transferred to an FTP server in any format. This is useful when the report needs to be sent to a regional council FTP server.

{% hint style="info" %}
**Applies to:** DATRAN Reporting V6.05 and later. V6.05 provides essential maintenance updates for systems that connect and report via email using servers provided by Google and Microsoft, including Office365 mail, which now use TLS V1.2 authentication. V6.02: Added support for the FTPES protocol and improved the FTP process. Enabled the ability to set the hour and minute a scheduled report is sent.
{% endhint %}

## Schedule a report

1. In the DATRAN Report Explorer, select the report you want to schedule.
2. Go to **Scheduled Reports** view, click **Insert** button.
3. Set the **Next Run Date** to determine when this report will start being printed, saved, emailed and/or transferred to an FTP server periodically.
4. Set the frequency that the report will be printed, saved, emailed and/or transferred to an FTP server via the **Period** combo box. You have a choice of:
   * Daily
   * Weekly
   * Monthly
   * Annual
5. Finally click on the commit button.
6. The schedule for this report should appear in the schedule grid.

![Individual schedules: a flow report run monthly and an alarm report run weekly](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2F3QJCLSsywJDJNsN2gesZ%2Freporting-individual-schedules.png?alt=media)

Scheduled views must be used for scheduled reports. If not, the reports that are printed will always include data within the same period. See [Database tables and views for reports](https://help.qtech.co.nz/datran/datran-vi-scada/datran-reporting/database-views.md).

Success/Fail Diagnostic view: This display shows the success/fail status of each scheduled report. This helps ensure you know the reports were actually sent etc. Put an event log in Windows each time a report is printed/saved/emailed/transferred to FTP server.

Manual run of scheduled report should disregard Next Run Date.

## Set up email

1. If you have not configured your Simple Mail Transfer Protocol (SMTP) connection login, do so via the main menu **Tools | Options...**
2. In the Options dialogue, fill in the SMTP connection login host address (the address of your organisation or company mail server), your user name and password to that mail server. Also remember to fill in the following details:

| Setting                                        | What to enter                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Host                                           | The SMTP connection login host address (the address of your organisation or company mail server)                                                                                                                                                              |
| User name, password                            | Your user name and password to that mail server                                                                                                                                                                                                               |
| From Name                                      | This is the name that appears in the sender section of your email.                                                                                                                                                                                            |
| From Address                                   | This is the email address where any replies to the emails sent by DATRAN Reporting are sent to.                                                                                                                                                               |
| Port Number                                    | This is the SMTP port number of the mail server. This is usually 25 for Microsoft Exchange Server and 465 for Gmail server. Servers provided by Google and Microsoft, including Office365 mail, now use TLS V1.2 authentication often explicitly on port 587. |
| Authentication                                 | For Microsoft Exchange Server use the Default setting.                                                                                                                                                                                                        |
| This server requires a secure connection (SSL) | Only tick the "This server requires a secure connection (SSL)" checkbox if the mail server requires it.                                                                                                                                                       |

3. Use the Test button to ensure that your SMTP connection login details are correct.
4. Click **OK**.

In the main menu, select **File | Send File...** In the Choose a Report Type dialogue box, select the type of report you want to generate and click OK. If the Search dialogue box comes up, enter the required values and click OK. In the ReportBuilder Email dialogue, specify at least one recipient email address in the To: field.

## Set up FTP

1. If you have not configured your File Transfer Protocol (FTP) connection login, do so via the main menu **Tools | Options...** In the Options dialogue, fill in the FTP connection login host address (the address of the regional council, organisation or company FTP server), your user name and password used to access the FTP server. Also, specify the directory to which the file will be transferred to. If the directory does not exist, it will be created if your FTP user has permission to do so.
2. Use the Test button to ensure that your FTP connection login details are correct. Click **OK**.

In the main menu, select **File | Transfer As File...** In the Choose a Report Type dialogue box, select the type of report you want to generate and click OK. If the Search dialogue box comes up, enter the required values and click OK.

* V6.02: Added support for the FTPES protocol and improved the FTP process.
* V6.04: Datran Reporting now uses the global variable of date/time stamp for printing to FTP. i.e., Reports can now be created with or without the timestamp appended to the file name in the case where a specific filename is expected when transmitting via ftp.
* When an FTP report fails, an email is sent to notify the users of the error.
* Allow user to define how automatically generated files should be named.

## Security limits

Future work is required to support TLS 1.3 when the library becomes available. Until then, DATRAN Reporting will only run when connecting to email or FTP servers that use secure socket layers TLS 1.2 or lower. If reports stop sending, see [Scheduled reports aren't emailed or sent by FTP](https://help.qtech.co.nz/datran/datran-vi-scada/datran-reporting/troubleshooting/reports-not-sent.md).
