ReportRunner runreport Command and Examples

Use the runreport command in ReportRunner to run a report. By default, the last filter loaded is used unless you use the loadfilter command to load a specific filter.

Parameters for the runreport Command and Examples

Command parameters are:

  • --server: The report server name.
  • --report: The report name.
  • --format: The report output format (PDF or Excel).
  • --file: The name and location of the resulting file to save.
  • --email provides the names of email recipients. Use commas to separate multiple email addresses.
  • --sender provides the email address of the sender. This parameter is required when using the --email parameter.
  • --subject provides a subject line for the email. This parameter is relevant but optional when using the --email parameter. If not provided, a default subject is used.
  • --message provides a body for the email message. This parameter is relevant but optional when using the --email parameter. If not provided, a default message body is used.
  • --add provides the means to send additional parameters to reports that require them. For example, the CAMHistory report needs a parameter named "CAMHistoryInputAction", which tells what history information to report on.

Example Use

The following command starts ReportRunner and runs a report:

ReportRunner runreport --server=reportservername --report=ActivityLogByMachine --format=pdf --file=C:\MyReport.pdf

Where:

  • ReportRunner is the name of the executable program.
  • runreport is the command for running a report.
  • --server is the name of the server that hosts the report generation application.
  • --report specifies that the ActivityLogByMachine should be run.
  • --format specifies that the report should be saved in PDF format.
  • --file specifies that the file is named MyReport.pdf and saved in the C:\ folder on the user's machine.

Many reports have additional parameters. For example, you can use the --add command to limit report results by specific events or input actions.

ReportRunner runreport --reportservername --report=CamHistoryDetail --add=CamHistoryInputAction=machines --format=pdf --file=C:\temp\MyReport.pdf

To learn about report-specific parameters, see Reports You Can Run with the ReportRunner Application.

Example: Send a Scheduled Report by Email

If you want to send the report output by email, rather than save it to a file, use a command such as:

ReportRunner runreport --server=reportservername --report=ActivityLogByMachine --format=pdf [email protected],[email protected] [email protected] "--subject=Updated report" "--message=Updated activity log by machine report"

With this command, a PDF of the report is sent as an email attachment.

Example: Generate a Report in Excel Spreadsheet Format

ReportRunner also provides an Excel output option. The following is an example:

ReportRunner runreport --server=reportservername --report=ActivityLogByMachine --format=excel --file=C:\MyReports\ActivityLogByMachine.xls

Where:

  • --format=excel specifies that the report system generates an Excel-formatted output file.
  • --file provides an output file name with an extension that Windows associates with the Microsoft Excel application.