How to Schedule and Email Reports Using ReportRunner
ReportRunner is a command-line application that allows you to schedule reports to run at specified times, then save or email reports to one or more recipients.
ReportRunner is installed on the machine where you installed CAM Administrator. Depending on how you installed CAM, the Reportrunner.exe file is located in one of the following locations:
- On 64-bit systems:
C:\Program Files (x86)\Cherwell Asset Management\CAM Administrator\Report Runner
- On 32-bit systems:
C:\Program Files\Cherwell Asset Management\CAM Administrator\Report Runner
You can run ReportRunner:
- From the command line.
Try this method first to test that the syntax is correct and that the application yields the expected results.
- From a batch file you've created.
Use a batch file to run multiple commands. Enter commands in the order you want them to run, with appropriate arguments. Once you're satisfied with the batch file, you can use Windows Scheduler to run it at the planned time, with the appropriate credentials. You can also run the batch file anytime you want to immediately run the commands included in it.
You can run most, but not all, reports using ReportRunner. See Reports You Can Run with the ReportRunner Application.
ReportRunner is not available for CAM hosted environments or when CSM authentication is used.
Whether you're running ReportRunner from a command line or a batch file, you use the same syntax:
ReportRunner <command> <command parameters>
ReportRunner includes two commands:
- loadfilter, which loads a named filter for a specific filter owner. See ReportRunner loadfilter Command and Examples. Typically, you use the loadfilter command to specify which filter to use, then use the runreport to run the report.
- runreport, which runs a report on behalf of a particular user, using whatever filter was last loaded for that user if the loadfilter command is not used. See ReportRunner runreport Command and Examples.
Notes for Both Commands
- The application name (ReportRunner) must always come first, followed by the command (loadfilter or runreport). After that, command parameters can be used in any order.
- If there are spaces in any of your arguments (for example, in the
name of the folder where you want to store the output file), enclose the
argument in quotation marks. Note how quotation marks are used with the --file
argument in the below example:
reportrunner runreport --server=reportservername --report=LicenseAllocationByLicenseUnit --format=pdf "--file=C:\My Documents\test.pdf"
- You cannot use an ampersand (&) character in any parameter value, such as in the name of a license unit or other value printed in a report. Replace the "&" with the word "and". For example, if a particular report requires a "name" parameter, and the name contains an "&", replace the ampersand with the word "and".
Getting More Help
You can type the following in the command window for additional help with ReportRunner commands and parameters:
ReportRunner help <command name or parameter>
For example, you can type the following to view help on the --server parameter:
ReportRunner help --server