Scheduled Report

Scheduled Report is a job that can be configured to periodically run a report and write the output to a file, email it, and/or print it.

The fields are as follows:

  • Report
The report to run.
  • Name
The job name. Defaults to the report name
  • Description
The job description. Defaults to the report description
  • Active
This schedules the job to run if checked, or prevents it from being run if unchecked.
  • Location
The location to pass to the report. Available via the OpenVPMS.location field.
  • Report Name
The name of the report, when it is written to a file, or emailed as an attachment. This can be further customised by specifying Report Name Format.
If not specified, the report name will be derived using Report.
  • Report Name Format
Used to format the Report Name, e.g. to append the current date.
If not specified, the File Name Format of the associated Report will be used. Available formats are determined by Administration - Lookups - File Name Format
  • File

If selected, writes the report as a file to the specified directory.

  • Directory
The directory to write the report to. Only valid when File is selected.
  • File Type
The type of file to write. Only valid when File is selected.
  • Email
If selected, emails the report.
  • Email From
The address to email the report from. Only valid when Email is selected.
  • Email To
The addresses to email the report to. Up to 5 addresses may be specified. Only valid when Email is selected.
  • Attachment Type
The type of the email attachment. Only valid when Email is selected.
  • Print
If selected, prints the report
  • Printer
The printer to print the report to. Only valid when Print is selected.
  • Minutes
See Cron Expression
  • Hours
See Cron Expression
  • Day Of Month
See Cron Expression
  • Month
See Cron Expression
  • Day Of Week
See Cron Expression
  • Run As

Specifies the user to run the job as. This user is required to have permissions to:

  • send notification messages
  • Notify
Specifies the user or user group to notify when reporting has completed.
  • Notify On Success

If deselected, notification only occurs when reporting fails.

If selected, notification also occurs when reporting is successful

  • Parameters

The report parameters, obtained from the report when it is first selected.

Date parameters may be fixed, or calculated. This is determined by a dropdown with the following options:

  • Date
use a fixed date
  • Now
use the current date and time
  • Today
use today's date
  • Tomorrow
use tomorrow's date
  • Yesterday
use yesterday's date
  • Start of Month
use the first day of the current month
  • End of Month
use the last day of the current month
  • Start of Last Month
use the first day of last month
  • End of Last Month
use the last day of last month
  • Start of Next Month
use the first day of next month
  • End of Next Month
use the last day of next month
  • Start Of Year
use the first day of the current year
  • End of Year
use the last day of the current year
  • Start of Last Year
use the first day of last year
  • End of Last Year
use the last day of last year
  • Start of Next Year
use the first day of next year
  • End of Next Year
use the last day of next year
  • June 30
use June 30th of the current year
  • June 30 - Last Year
use June 30th of last year
  • June 30 - Next Year
use June 30th of next year
  • July 1
use July 1st of the current year
  • July 1 - Last Year
use July 1st of last year
  • July 1 - Next Year
use July 1st of next year

Calculated date parameters may have an offset, expressed in days, weeks, months or years.  E.g.:

  • Today - 3 Months
subtracts three months from the current date
  • Start Of Month + 1 Years
adds one year to the first day of the current month

 

Cron Expression

 

The Minutes, Hours, Day Of Month, Month, and Day Of Week fields determine when the job is run, using a simplified version of a Cron expression:

Field Allowed Values Allowed Special Characters
Minutes 0-59 , - * /
Hours 0-23 , - * /
Day Of Month 1-31 , - * ? /
Month 1-12 or JAN-DEC , - * /
Day Of Week 1-7 or SUN-SAT , - * ? /

Note that only one of Day Of Month and Day Of Week may be specified. If one is specified, the other must be set to ?.

If you change the schedule, the new schedule will take effect immediately.

Examples

 

Description Minutes Hours Day Of Month Month Day Of Week
Run at 8am every day 0 8 ? * *
Run at 8:30 on weekdays 30 8 ? * mon-fri
Syndicate content