Using the report scheduler wizard, you set up a job, report parameters, and output options:
• Set up a job – A job name, when to run the job, and how often
• Report parameters – If the report was designed with input controls, which parameters the job will use
• Output options – Where to store the output, in which formats, the locale, and email options for sending the output as an attachment
Jobs that you schedule run the reports in the background so you can use the server while the report runs.
The permissions of the user who schedules a job determine the data that the report exposes. For example, Gloria only has access to inventory data from the Southeast US region. A report that she schedules only shows data from that region, even when the report is viewed by users in other regions. Other users schedule the report themselves to see the data for their own regions.
|
Sensitive data could be exposed to unauthorized users if you schedule a job as an administrative user with no data restrictions because the report will contain all requested data in the data source. Any user who receives the report can view all the data regardless of the user’s access restrictions. |
1. On the Home page, click View Reports; or from any page, click View Repository.
2. Use the search field or browse the list of reports to find the report you want to schedule.
|
If the report already has a schedule that you want to add, modify, or delete, click beside the report name. |
3. Right-click the report and select Schedule... from the context menu.
The Scheduled Jobs page appears, as shown in See "The Scheduled Jobs Page for the Freight Report".
4. Click Schedule Job.
The Set Up the Job page of the Scheduler wizard appears.
5. In the Job Name field, enter a name for the job, for example, Weekly Report. The description is optional.
6. Set these schedule attributes:
• Start: Immediately or in the future. Click to select a future start date and time. If you don’t specify recurrence, the start date and time determines when the report runs. If you specify recurrence, you may still want to delay the first report date, for example a weekday report that you want to start next week.
• 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’re in a different time zone, set this field accordingly.
• Recurrence: Choose one of the following settings:
None: Run the report once.
Simple: Schedule the job to recur at an hourly, daily, or weekly interval.
Calendar: Schedule the job to recur on days of the week or days of the month.
See "Set Up the Job Page" shows a job set to run immediately, no recurrence:
|
7. Schedule the job to start at a specific time:
In Start Job, select On.
a. | Click . |
The calendar appears.
b. | Click a date. |
c. | To set the time for the job to run, at the bottom of the calendar, repeatedly click the hours and minutes. To close the calendar, click a blank spot on the Scheduler page. |
The selected date for starting the job appears in the calendar field.
d. | In Recurrence, accept the default setting, None to run the report only once. |
|
If you select Simple or Calendar Recurrence, additional controls appear on the page. For details, see section Running a Job Repeatedly. |
8. Click Next.
If the report you are scheduling has input controls that prompt for user input, the Set the Parameter Values page appears:
|
Saved values, if there are any, appear in a drop-down list at the top of the page, as shown in See "Set the Parameter Values Page for Scheduling a Report". In the Use saved values drop-down, you can set the input controls defined for the report you’re scheduling. You can set the input values for the scheduled report, and click Save Current Values to save the input value as a named set of values.
For more information about using saved values and saving input values, see section Running a Report with Input Controls or Filters.
9. Choose a set of saved values, or set the input controls. This example uses the saved values for USA.
10. Click Next.
The Output Settings page, shown in See "Output Page for Scheduling a Report", appears.
11. Set output options, as described in the next section, and click Submit to schedule the job.
On the Output Details page, you can change these settings:
• Base Output File Name – The name of the file as it appears in the repository.
• Output Description – The optional description of the file that appears to users who view the repository.
• Output Format – The available output formats. Select one, or accept the default format, PDF. When you select more than one, each format is stored as a separate file in the repository and attached as a separate file to the email notification.
• Output Locale – The locale settings for generating the report.
The report must support locales, for example a report based on a Domain with language bundles (see section Security and Locale Information for a Domain).
• To – One or more email addresses separated by commas for sending email notification.
|
By default, the mail server is not configured by the JasperReports Server installer. To send email notifications, the administrator must configure the mail server, as described in the JasperReports Server Installation Guide. |
• Subject – The subject line of the notification email.
• Message – Content of the notification email.
• Attach Files – A check box option that, if checked, sends the output of the report with the email notification.
|
Be careful when sending reports containing sensitive data by email. |
• Skip Empty Reports – A check box option that, if checked, prevents the server from attaching empty report output files to email notification when report execution fails.
• Output Location – The folder for saving the report output. This field is required and you must have write permission to the folder.
• Sequential File Names – Appends a timestamp to the names of files created by the job. 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 filename is <basename>-<timestamp>.<extension>.
• Timestamp Pattern – An optional pattern for the timestamp, based on the java.text.SimpleDateFormat. Valid patterns for report output files can only contain letters, numbers, dashes, underscores, and periods. The default pattern is yyyyMMddHHmm, for example 200906150601.
• For more information about the valid patterns for this field, refer to:
http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
• Overwrite Files – A check box option that, if checked, overwrites old output files with newer ones of the same name. Useful when you do not have sequential filenames, or you specify a timestamp pattern that may lead to identical filenames.
|
When you click Submit, the job appears in the list of scheduled jobs.
Scheduled jobs appear in the repository with a icon beside the report name. To view the list of scheduled jobs for a report, locate a report in the repository, right-click the report, and select Schedule from the context menu. The Scheduled Jobs page appears for the report.
|
Typical users only see the jobs that they have defined themselves; administrators see the jobs defined by all users. In See "The Scheduled Jobs Page for the Freight Report", Joe User has scheduled two jobs for the Employees Report.
The Scheduled Jobs page shows the internal ID number of the job, the user (owner) who created the job, and the state of the job. Job states are:
• Normal – The job is scheduled.
• Running – The server is generating the report output.
• Complete – The server has finished running the job and placed output to the repository.
• Error – The scheduler encountered an error while scheduling or triggering the job. This doesn’t include cases where the job is successfully triggered, but an error occurs while it runs.
The Scheduled Jobs page includes two controls:
• Edit – Changes the schedule.
• Remove – Cancels the scheduled job.
When the server receives a request to delete a job that is running, the server completes running the job before deleting it.
Buttons on the Scheduled Jobs page include:
Button |
Description |
Back |
|
Schedule Job |
Opens the Job Details page to define a new job. |
Run Now |
Runs the report in the background, allowing you to continue working in the server. See section Running a Job in the Background. |
Refresh List |
Refreshes the list of jobs, for example to see if a job has finished running. |
When the start date for a job has passed, start a new job rather than changing the start date.
1. Open the Scheduled Jobs page for the report, as described in section Setting Up a Job.
2. Click Edit in the row of the job you want to change.
3. Make the changes on the Job Details, Schedule, Parameters, and Output pages.
4. Click Save. The update occurs immediately.
To stop a job from running, delete it.
To delete a scheduled job:
1. Open the Scheduled Jobs page for the report, as described in section Setting Up a Job.
2. In the row of the job you want to delete, click Remove.
To run reports automatically on a regular basis, select simple or calendar recurrence on the Set Up the Job page:
• Simple recurrence repeatedly runs the job at an hourly, daily, or weekly interval, and is quick to set up.
• Calendar recurrence involves more settings: time of day, days of the week, or days of the month, and months of the year.
See "Simple Recurrence Settings" shows an example of how to set simple recurrence.
|
Simple recurrence options are:
• Repeat every – The interval between jobs, in minutes, hours, days, or weeks.
• Indefinitely – Runs until you delete the job.
• Times – Runs the specified number of times.
• Until – Runs until a calendar date is reached. Click the calendar icon, , to select the date.
|
If your server recognizes Daylight Savings Time (DST), jobs scheduled using simple recurrence may seem to occur one hour later (when DST ends) or one hour earlier (when DST begins). If you want jobs to recur at the same time of day and respect DST adjustments, use calendar recurrence. |
See "Calendar Recurrence Settings" shows an example of calendar recurrence settings.
|
Calendar recurrence options are:
• Months – The months during which the report runs.
• Days – The days when 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, entering 0, 15, 30, 45 for the minutes, and 9-17 for the hours, runs the report 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 – Calendar recurrence runs until a calendar date is reached. Click to select the date.
Running a job in the background generates a report, potentially long-running, without affecting performance. You can keep working in the server as the job runs. When the job completes, 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 by email.
Running a job in the background is equivalent to scheduling the report to run immediately without recurrence.
To run a job in the background:
1. On the Home page, click View Your Reports; or from any page, click View Reports.
2. Use the search field or Filters to find the report you want to run.
3. Right-click the report and select Run in Background from the context menu.
|
If the report you’re running has input controls or filters that prompt for user input, a page appears for setting parameter values, as shown in See "Set the Parameter Values Page for Scheduling a Report". |
4. Choose a set of saved values, or set the fields one at a time.
5. Click Next.
The Output page appears as shown in Output Page for Scheduling a Report.
6. Enter the information as described in See "When you click Submit, the job appears in the list of scheduled jobs.".
7. Click Save.
The report begins to run immediately.
When you add a parameter named _ScheduledTime to a JRXML report design in iReport Designer, and then schedule the report to run in the server, the output includes a date/time stamp showing when the report ran. The following procedure describes how to set up and use this parameter:
To display the date/time that the report ran:
1. Launch iReport, and open an existing report.
2. In the Report Inspector, right-click Parameters, and select Add Parameter.
3. Rename the parameter _ScheduledTime.
The new parameter appears in the report inspector:
|
_ScheduledTime Parameter in the Report Inspector |
4. Set the following parameter properties:
• Parameter Class = java.util.Date
• Use as a prompt = unchecked
|
_ScheduledTime Parameter Properties |
5. Drag the _ScheduledTime element from the Report Inspector to a valid location, such as the header, in the Designer:
|
Report Design Includes the _ScheduledTime Parameter Element |
6. Now you can set other properties, such as the text color of the date/time stamp. In Properties, check Blank when Null to prevent the word null from appearing on the report when it runs unscheduled.
7. Compile the report, and add it to the server as a report unit. For more information about how to add the report unit to the server, see section Adding a Simple Report Unit to the Server.
8. In the server, schedule the report to run immediately.
9. Open the output file:
|
Output Showing the Scheduled Time the Report Actually Ran |
The date and time the report actually ran appears in the output.