2.4 Scheduling Reports

2.4.1 Scheduling and Running a Report

You can set up the job, when to run it, and how often to run it.

  1. On the Home page, click Reports, or click View > Repository.

    You can also create a schedule from the dashboard in view and edit mode, and from the report viewer. On the toolbar, click the schedule icon.

  2. Right-click the report name, then select Schedule.

  3. Click Schedule Job, to display the Scheduler panel.

  4. Set the following schedule attributes:

    • Start Job: Choose one of the following:

      • Immediately: Start the job as soon as you finish it.

      • On Specific Date: Start the job at future time. Click the calendar icon and select the future start date and time. To set the time for the job to run, at the bottom of the calendar, click the hours and minutes.

    • Time Zone: Specify the time zone for the schedule. The default time zone is the time zone of the server, the time zone you entered at log in. If you are in a different time zone, set this field accordingly.

    • Recurrence: Choose one of the following settings:

      • None: Run the report once.

      • Simple: Repeat the job at an hourly, daily, or weekly interval.

      • Calendar: Repeat the job on days of the week or days of the month.

        If you select Simple or Calendar, additional fields are displayed. For more information, see Section 2.4.4, Simple and Calendar Options.

  5. Click Save.

  6. In the Schedule Job Name field, specify a name for the job, for example, Weekly Report. The description isoptional.

  7. (Conditional) If the report you are scheduling has input controls, you are prompted for the input.

    If there are any Saved values, they display in a drop-down list at the top of the Set the Parameter Values panel. In the Use saved values drop-down, you can set the input controls defined for the report that you are scheduling. You can set the input values for the scheduled report, and click Save Current Values to save the input value.

  8. Choose a set of saved values, or set the input controls, then click Save.

  9. Set output options in the Output Settings panel.

    For more information, see Section 2.4.2, Output Options.

  10. Click Save.

    The job displays in the list of Scheduled Jobs, as shown in Step 2.

  11. Click Run Now to run the report in the background.

2.4.2 Output Options

In the Output Details panel, you can change the output settings. You must first setup the job, then output options.

For information, see Section 2.4.1, Scheduling and Running a Report.

On the Output Details panel, you can change these settings:

  • File Name: Specify a name for the Job file.

  • Description: (Optional) Specify a description for the Job file.

  • Output Locale: Select the locale settings for generating the report.

    The report must support locales, for example a report based on a domain with language bundles.

  • Formats: Select the format in which you want to save the Job file. When you select more than one format, each format is stored as a separate file in the repository and attached as a separate file to the email notification.

  • Overwrite Files: Select this option to overwrite old output files with new files. This is useful when you do not have sequential file names or when you specify a timestamp pattern that could lead to identical file names.

  • Sequential File Names: Select this option to append a timestamp to the names of files created by the job. This is useful for the output of recurring jobs or for time-sensitive reports where the output must be dated. When the timestamp is used, the output of the file name is <basename>-<timestamp>.<extension>.

  • Timestamp Pattern: An optional pattern for the timestamp. Valid patterns for report output files can only contain letters, numbers, dashes, underscores, and periods. The default pattern is yyyyMMddHHmm. For example, 201307030601.

  • Output Destination - To save the output file, select one or more checkboxes to specify the output location. If you do not want to save the report output (for example, if you only want to email the report) leave all checkboxes blank.

    • Output To Repository – If checked, saves the report output to the specified location in the repository. You must have write permission to the output folder. JasperReports Server validates the path when you click Save and will display an error message if the location does not exist. You can change the repository location that appears here by default.

    • Output To Host File System – If checked, saves the report output to the specified folder on the Server host machine; check with your administrator for the correct location to enter. Output To Host File System must be configured by an administrator; if the check box is grayed out, saving to the host file system has not been enabled for your system.

    • Output To FTP Server– If checked, saves the report output to the specified FTP server. You must have write permission to the selected directory on the FTP server. Enter the following properties of your FTP server:

      • Server Address – The host, IP address or URL of the FTP server.

      • Port – Specifies the FTP connection port. For FTP, the default port is 21; for FTPS, the default port is 990; for SFTP, the default port is 22.

      • Transfer Protocol – Specifies the file transfer protocol that the server uses. You can select one of the following:

        • FTP

        • FTPS (FTP over SSL)

        • SFTP (FTP over SSH). If selected, the SSH Key Authentication checkbox and SSH private key fields appear

        • SSH Key Authentication - Check if the server requires an SSH private key for SFTP transfers.

        • Path to SSH Private Key - When SSH Key Authentication is checked, the location of the SSH private key in the repository is required.

        • SSH Key Passphrase - When SSH Key Authentication is checked, enter the passphrase for the SSH private key, if it has one.

  • Directory – The directory on the FTP server where the report output is saved.

  • Username – The username for access to the FTP server.

  • Password – The password for the username.

When you click Save, the job appears in the list of scheduled jobs.

2.4.3 Viewing the List of Scheduled Jobs

Scheduled jobs are displayed in the Repository panel with a icon. Users can view the jobs that they have defined; administrators can view the jobs defined by all users.

  1. On the Home page, click Reports.

  2. Right-click the report, then select Schedule.

    The list of scheduled jobs is displayed.

The Scheduled Jobs panel displays the ID for the job, the owner who created the job, and the status of the job. The job statuses includes the following:

  • Normal: The job is scheduled.

  • Running: The server is generating the report.

  • Complete: The server has finished running the job and placed the output file in the repository.

  • Error: The scheduler encountered an error while scheduling or triggering the job. This does not include cases in which the job is successfully triggered but an error occurs while it runs.

  • Unknown: The scheduler encountered an error with the triggered job.

The Scheduled Jobs panel includes the following options:

  • Edit: You can edit the scheduled job and save the changes.

  • Remove: You can delete the scheduled job.

    When the server receives a request to delete a job that is running, the server finishes running the job before deleting it.

You can perform the following tasks from the Scheduled Jobs panel:

  • Click Back to go back to the list of reports.

  • Click Schedule Job to define a new job.

  • Click Run Now to run the report in the background, while you continue working on the server.

  • Click Refresh List to view the latest jobs.

2.4.4 Simple and Calendar Options

To run reports automatically on a regular basis, select simple or calendar recurrences on the Set Up the Job page:

  • A Simple recurrence regularly runs the job at an hourly, daily, or weekly interval. If you use Simple recurrence, the report runtime can change if the server is restarted.

  • A Calendar recurrence involves more settings: time of day, days of the week, or days of the month and months of the year. If you use Calendar recurrence, the report runs at the same time, even if the server is restarted.

Simple recurrence options are:

  • Repeat every: Sets the interval between jobs, in minutes, hours, days, or weeks.

  • Run Indefinitely: Runs the job until you delete it.

  • Run a set number of times: Runs the job for a specified number of times.

  • Run until a specified date: Runs a job until the specified date is reached. Click to select the date.

  • Holidays: A holiday calendar specifies a list of days when the scheduled report will not run. Only one holiday calendar can be selected at a time.

Calendar recurrence options are:

  • Months: The months during which the report runs.

  • Days: The days on which the report runs:

    • Every Day

    • Week Days

    • Month Days: Enter dates or date ranges, separated by commas. For example: 1, 15.

  • Times: The time of day in minutes and hours when the job should run. The hours use 24-hour format.

    You can also enter multiple minutes or hours, and ranges, separated by commas. For example, if you specify 0, 15, 30, and 45 for the minutes, and 9-17 for the hours, the report runs every 15 minutes from 9:00 A.M. to 5:45 P.M. Enter an asterisk (*) to run the job every minute or every hour.

  • Recur Until: The Calendar recurrence runs until the specified date is reached. Click to select the date.

  • Holidays: A holiday calendar specifies a list of days when the scheduled report will not run. Only one holiday calendar can be selected at a time.

2.4.5 Running a Job in the Background

Running a job in the background generates a report, potentially without affecting performance of the server. After the job is finished, you can export the report directly to any format and save it in the repository. You can share a report with others by sending the generated report through email.

Running a job in the background is equivalent to scheduling the report to run immediately.

  1. On the Home page, click Reports.

  2. Right-click the report, then select Run in Background.

    If the report that you are running has input controls or filters, you are prompted for the inputs.

  3. Choose a set of saved values, or set the fields one at a time, then click Next.

  4. In the Setting Output Options panel, specify the details, then click Submit. For output options, see Section 2.4.2, Output Options.

  5. Click Save.

    The report runs immediately.