Report Scheduler App EN

Basic functioning of the report scheduler

Using the report scheduler, report filters saved in advance under a free name can be selected and automatically executed on a regular basis.
This makes it possible to quickly schedule an already saved report filter without having to select the filter parameters again on each report scheduler entry. Since the parameters for each report may differ, this is the simplest solution to pre-filter a report and have it run.

The available report filters are determined via a technical user with cross-user rights. Access to this data is via REST API and therefore requires secure 2-factor authentication (OAuth2).

The execution interval can be freely set, as can the destination for the finished report. FTP/SFTP, directory on the web server and sending by email via the system-wide configured SMTP email accounts are available here.

Setup and configuration

For the basic setup of the report scheduler a few configurations are necessary:

  • Technical iAGENT user with comprehensive authorisation and the “Agent” check mark.
  • OAuth2 entry for release with 2-factor authentication
  • Configuration on the Report Scheduler App

Create iAGENT user

A user is required who has the right to see saved report templates of all users. The automatically created rights of the saved reports would either have to be assigned to one of his system groups or, if his own security policies allow it, the administrator group would have to be assigned to the user. Then this user automatically has the right to see newly saved report filters.

This user is required to view the available saved reports on the Report Scheduler screen. If a saved (shared) report filter does not appear here, the user most likely does not have the right to see this saved report filter.

Please note the access data for this user, they will be needed later in the configuration on the report scheduler app.

Create OAuth 2 entry

For two-factor authentication via the app to work on sensitive iAGENT data, a Client ID and Secret must be set up. This is done via the corresponding supervisor interface in the menu “Administration->System->OAuth2 applications”.

Please enter a free name and a free client ID. The secret is generated automatically and randomly, but can be renewed by clicking the “New Secret” button. Now save the entry. After saving, copy the client ID and the secret for later (display the secret beforehand using the “Show Secret” button).

URL is not necessary and can be left blank.

Configuring the Report Scheduler App

Upload the Report Scheduler App via the Supervisor menu item “Administration->System->Apps”, if not already done (see https://apps.novomind.com) and open its configuration interface by clicking on the entry in the App list of the Supervisor.

REST API AUTHENTICATION

Now enter the following data:

OAuth Client ID: The client ID from the OAuth2 applications configured above.

OAuth Client Secret: The generated secret from the OAuth2 applications configured above.

OAuth Token Endpoint: https://<URL-to-iAGENT-server>/iMail/api/rest/token (e.g. https://iagent-demo.novomind.com/iMail/api/rest/token)

Username: Username of the created, technical iAGENT user (see above)

Password: Password of the created, technical iAGENT user (see above)

REST API ENDPOINTS

Get Reports Endpoint: https://<URL-to-iAGENT-server>/iMail/api/rest/prefilledreports

Trigger Report Endpoint: https://<URL-to-the-iAGENT-server>/iMail/api/rest/prefilledreports/{}/execute (the empty braces are supposed to be like this, this is the placeholder for the selected report!)

EMAIL CONFIGURATION

Here you enter the email server, the username of the mail account and the port (default SMTP is 25).

The sender’s address and the address to which faulty executions are reported can also be entered here.

It is important to check whether the specified user account of the mail account is allowed to send mails via the specified sender address – this only needs to be observed if the email addresses of the specified mail account and the sender address differ.

ATTENTION:
Only as soon as a report scheduler entry is created for the automatic execution of the report is it checked whether the SMTP configuration is valid and works! If this is not the case, an error message is displayed:

FTP and SFTP CONFIGURATION

Access data must be entered in the fields accordingly.

Scheduling reports

Now the configuration is complete and reports can be scheduled as follows.

Create Report Filter

The desired report is opened via the Supervisor main menu. Example:
“Reports->Mail->Completed”

Now the desired filters for the period, categories etc. are set as they are to be applied in the report.

Date selection:
It should be noted that the desired period should be selected dynamically. Therefore, in the calendar selection on a date filter, there are the relative time specifications such as “last month” or “this year”. These relative time specifications are stored in such a way that they are determined anew for each future report execution. Fixed date filters, on the other hand, are not changed, which means that the scheduled reports could provide the same data each time.

After selecting all relevant filter criteria, the report must be run once for testing. If the result is as desired, the set filter can be saved via the “Save” button.

When saving, a dialogue appears in which a free name can be given and the filter criteria to be saved can be selected and deselected. The recommendation here is to leave all tick marks set.

Now we have created a report filter that we can select on the report scheduler app.

Scheduling Report Execution

Via the supervisor main menu “Apps->REPORT SCHEDULER”, the app for scheduling reports can now be opened.

The “New” button allows the creation of a new entry. In the dialogue, the previously created report filter can now be selected via a drop-down list “Report name”.

The resulting file name of the respective report execution can be configured in the field below and supplemented by dynamic placeholders: {report_name}, {report_id}, {yyyy}, {MM}, {dd}, {HH} or {mm}.

Furthermore, the output language of the report and the file format XLSX or CSV can be set.

The report file created in this way can then either be sent by email, stored on a directory path of the web server or uploaded via FTP/SFTP using the next fields.

The execution interval can be set via SCHEDULE.

For example, if the report is to be created on Mondays and Wednesdays, the following entry is required: