Chapter 10. Scheduling of Reports

10. Scheduling of Reports

ReportServer supports the timed execution of reports. In this section we will discuss how to view existing jobs with the administration interface as well as how to configure conditional schedule jobs. For a description of how to configure the e-mail server as well as the notifications about completed (or failed) executions refer to the ReportServer configuration guide.

The Scheduling module enables the user to browse their own jobs, to change or archive them. In addition, the module offers a variety of information on each job such as given times for next executions, or information on possible errors in previous executions. A detailed description on how to work with the module is given in the ReportServer user manual in section Scheduling.

The Administrator can call up an extended form of the Scheduling module via the Administration module. Here you see the jobs of all users, and, if required, may change or remove them. Please consider that after having changed a scheduler job, your user account will be entered in Scheduled by, and the user who originally created the job cannot edit it afterwards any more.

10.1. Technical Backgrounds to Scheduler Jobs

In the following we want to give a few technical details on scheduler job (or entries). A scheduler entry consists of a so-called job and one or more actions each. Here the job describes how to execute the report (further jobs could be the time controlled execution of scripts; refer to section "Scheduling of reports"), whereas actions describe what to do with the result (the completed report). At present, there are two options: Sending by e-mail or storing the result in a TeamSpace for later retrieval. Often instead of speaking of a scheduler entry (i.e., job plus actions) we simply speak of a scheduler job.

Errors may occur here on all levels. Running a job just as well as running individual actions might fail. If a report is not executable (for example, because the underlying data model has changed), the job cannot be executed. An example for a possible failure on the action level is that the e-mail server cannot be reached which would interrupt the sending of report results.

To display detailed information on successful or failed scheduler entries, from the list (on the left) select the respective entry and then double click in the details pane on a specific execution. In the pop-up window that opens, you will be given detailed information on the execution split up in job and actions. If there is a failure here you will be given a stack trace of the execution to draw conclusions as to what might be the failure cause.

If, for instance, the connection to the data source is not available at the moment of execution, ReportServer will produce an error message similar to the following one:

net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The
report could not be executed: Could not open connection to: jdbc:mysql://demo.db.raas.
datenwerke.net:3306/ClassicModels with user: demo. java.sql.SQLException: Timed out 
waiting for a free available connection.
10.2. Filtering by the Status of a Job

From the filters in the tool bar you can search for a specific job by its failure status. Report- Server jobs are always in one of 4 statuses.

Inactive The job is currently inactive If another execution at a later time is pending, the job will be selected at that time by the disposition module and prepared for execution.
Waiting to be executed If a job has been selected by the scheduler for execution, it will change to the status "Waiting to be executed". It will remain in this status until a free worker thread will start the execution.
Executing The job is being executed.
Critical failure This status will be set if an unforeseeable error occurred that requires manual action. The job will be exempt from further execution until the status is manually restored. To reset the status to "Inactive", click on the respective job and in Details double click on the field Execution status.
10.3. Notifications

After a scheduler job was executed ReportServer sends a notification by e-mail. If the report was scheduled into a TeamSpace, you can add a link to the completed report. Configure notification texts in the configuration file etc/scheduler/scheduler.cf. For further information on the configuration refer to the ReportServer configuration guide.

10.4. Conditional Scheduling

Beside regular scheduling of reports, ReportServer also supports conditional scheduling of reports. This allows users to specify requirements that will be checked before execution and only if they hold the job will be executed (refer to the ReportServer user manual section Scheduling). Possible ReportServer conditions will be configured with dynamic lists that have a single result line. Here is such a dynamic list that could be used as a scheduler condition:

A B C D
5 17 23 42

The list consists of four attributes A, B, C, D. If the list has been configured as a scheduler condition, users now can define conditions based on this list. ${} formula expressions define the conditions (here the user does not have to delimit the expression by "${" and "}". A feasible condition based on the list available would for instance be:

${A > 10 && D != 1}

Now, prior to execution, the expression would be compared to the current report values. Only if the condition evaluates to TRUE, the job will be executed.

To configure dynamic lists as a basis for conditional scheduling, use the terminal command rcondition (see Chapter 14. Terminal Commands).

10.5. Enhanced Scheduling

The Terminal enables to manually terminate or restart the Scheduler. In addition, it provides the option to schedule timer controlled scripts. For further information refer to Chapter Terminal commands (command scheduler) as well as to Chapter 13. ReportServer Scripting.