- Home
- DevShare
- Forums
- Wiki
- Products & Services
- Downloads
- Documentation
- Webinars
- Store
- Blog
In this lesson you'll schedule a report to run every night and to save the resulting report document to the server. This lesson demonstrates:
Contents |
We've already seen how to run a report on demand. iServer Express also lets you schedule reports to run in the future: either once or on a schedule. Each run of a report is called a "job", also sometimes called asynchronous jobs, batch jobs, batch reports, or background jobs. Each job runs a report and stores the resulting report document in a specified folder in the iServer Express folder system. iServer Express needs three pieces of information when you schedule a report to run later:
Let's see this in action.
A new browser window pops up, with three tabs: Schedule, Parameters, and Save As. This report has a required parameter, so the Parameters tab appears. (If the report had no parameters, this tab would not be displayed).
The screen changes and now displays fields where you can set the date and time when the report should run.
By default, the date and time are set to ten minutes from now, so you don’t have to change them.
iPortal makes it easy for report developers to specify that certain report parameters should be drop-down list boxes, checkboxes, radio buttons etc. Report developers can also tell iPortal to populate the list of all possible values for a parameter from a database. This particular report has a drop-down list for the "product code" parameter.
This report dynamically obtains the values in the drop-down list from the database. Another report could choose to use radio buttons or free-form text fields for the parameter. Or the report could hard-coded the possible parameter values instead of having them dynamically retrieved from a data source.
The “Save As” tab appears:
For this example we want to directly generate a PDF file and have it stored to iServer in the user’s home folder.
You will most often save report documents directly as report document instead of as PDF. A report document enables the full viewer features we saw earlier, including the ability to exported to PDF, Word, Excel, or PowerPoint format. In contrast, if your job directly generates PDF instead of a report document, you will not be able to later use the viewer or export the report. We use PDF here just to show how it is done is all you need.
iServer Express provides file versioning, something like a source code management system. Reports often run repeatedly, such as once per day. You will usually want to retain several day's output, say, the last five days. Rather than give each document a unique name "Sales Detail for March 13", say, iServer Express instead stores these documents as versions. Version 1 might be for March 11, version 2 for March 12, version 3 for March 13, etc. Versions can be a bit confusing at first if you've never used them in other systems, but you'll quickly appreciate them as you start accumulating report documents.
Let's see this in action:
iServer Express supports e-mail notification, but this feature is not available when you first install the software. Before you can use e-mail notification, you must configure the feature using the Configuration Console. Once e-mail is available, you can click the “Send me an email notification” checkbox. You can optionally attach the report to the e-mail in any of the export formats (Word, Excel, etc.) If you want an email without the report attached, you can select “no attachment” from the drop-down list; the email notification will include a hyperlink to the report’s location on iServer Express.
The job status dialog appears:
“My Jobs” lets you monitor the progress of scheduled jobs through the queue. You’re on the “Completed” jobs tab at first. There is nothing listed because your scheduled job has not run yet (it will run within the next 10 minutes).
At the time the job is to run you will see the job move to the Pending tab as it prepares to run, then to the Running tab once it starts to actually run, and finally to the Completed tab. After the report is completed, the Completed tab will look like this:
You can see that the most recent report run succeeded. There is also a link to directly open up the resultant PDF. You can also see that the schedule is expired, meaning that this job will not recur in the future.
You just scheduled a job to run one time. However, most scheduled jobs run on a repeated schedule. Let’s set up a job that will run the Order Details report every morning at 5:00 am. Each time the report runs the server will create a new report document version. We’ll keep the latest 5 days of Order Details report documents on iServer and after 5 days the older documents will automatically be deleted from the server.
On the “Save As” tab we'll leave everything as set by default except at the bottom under “If the file already exists.” Because we’re going to run this report every day, we’ll be generating a lot of report documents that have the same name. These will be saved as versions of our report document. To specify that we’re going to keep the latest 5 days of documents on iServer at any time:
The following product manuals at http://www.birt-exchange.com/modules/documentation/ provide more information.
The same documentation is available in your iServer Express install:
You can simply click on the Help link on each of the iPortal pages to get help with that specific page.