Summary

This article explains how you can configure Report Commander to send output from more than one report in a single e-mail message.

Overview

This article only applies to Report Commander 1.x. In Report Commander 2 and later, you can produce multiple exports in the same project and send them using a single e-mail task.

When you run Report Commander, each execution of Report Commander will only export a single report. Report Commander can then e-mail the output to designated recipients. However, there may be scenarios where you want to include the output from several reports in a single e-mail message. While this cannot be accomplished with a single run of Report Commander, it can be done using multiple runs: for all but one of the reports, you will run Report Commander (once for each report) to export the report to a file without e-mailing that file. For the final report,  you will run Report Commander to export the report and e-mail it along with the previously-created output files, using the "-attachfile" command-line option.

Steps

Suppose you have four reports that you want to export and send in a single e-mail message: report1.rpt, report2.rpt, report3.rpt, and report4.rpt. To accomplish this, you would run the following four Report Commander commands (with additional command-line options as needed to supply parameters, logins, and other settings):

adcrutil -report="report1.rpt" -exportformat=pdf -exportfile="c:\temp\report1.pdf"
adcrutil -report="report2.rpt" -exportformat=pdf -exportfile="c:\temp\report2.pdf"
adcrutil -report="report3.rpt" -exportformat=pdf -exportfile="c:\temp\report3.pdf"
adcrutil -report="report4.rpt" -exportformat=pdf -exportfile="c:\temp\report4.pdf" -emserver=mail.example.com -emsender="[email protected]" -emrecipient="[email protected]" -emsubject="Reports 1-4" -emtext="Reports 1-4 are attached" -attachfile="c:\temp\report1.pdf" -attachfile="c:\temp\report2.pdf" -attachfile="c:\temp\report3.pdf" -parameters 2012-12-01 2012-12-31

Notes:

The "attachfile" option is not available in the Command Line Builder. you will need to edit the command line generated by the Command Line Builder to include the "attachfile" options. When editing the command line, be sure you add the "attachfile" commands before the "-parameters" or "-namedparameters" option, as the parameters must always appear last on the command line.

It is not necessary to include an "attachfile" option for report4, because Report Commander is automatically including report4 in the message.

Limitations

The "-attachfile" option will not work properly with "dynamic" output file names (file names specified with date/time tokens) unless you have version 1.5.0.100 or later. The version installed by the version 1.5 installer is version 1.5.0.61, which does not include the necessary change. You can download the latest hotfix to update to a version that includes the update. If you are using Report Commander 1.6 or later, no hotfix is required.