Email tags
Note
The Pay Statements report, which reports printed payroll checks and direct deposit advice to employees, does not require you to embed tags in the report design.
Use Crystal Reports to add an ActivityHD email tag to a report design.
ActivityHD email tags use XML syntax and follow the form:
<ActivityEmail ToAddress="..." CCAddress="..." BCCAddress="..." Subject="..." SQLConditions="...">
<Filter Name="...">
<Parameter Name="...." Value="...." Expression="...."/>(n)
</Filter>(n)
</ActivityEmail>
Rules for valid tags:
- At least one address is required.
-
Filters and SQLConditions allow portions of the report to be sent separately.
Tip
Filters are preferable to SQLConditions. Filters are less technical, don't require special security access, and can be tested from ActivityHD Explorer.
- SQLConditions require users who run the report to have edit access to the SelectionSQL resource.
- The tag should be located in the body of the report - not in the page header or footer.
Example of ActivityEmailTag report formula
'<ActivityEmail' +
' ToAddress="' + {GroupAnalysis.Employee_WorkEmail} + '"' +
' Subject="' +
{GroupAnalysis.Employee_FirstNameFirst} +
' USA Tax Withheld ' +
ToText ({GroupAnalysis.Check_CheckDate}, 'MM-dd-yyyy') +
'">' +
'<Filter Name="? Employee ID">' +
' <Parameter Name="Employee ID" Value="' + {GroupAnalysis.Employee_PREmployee} + '" />' +
'<Filter> ' +
'</ActivityEmail>'
Note
Ensure that the filter/parameter in the tag returns the desired result. While the email tag may appear in the footer for a particular employee, that doesn't mean the report for that employee will be emailed. If the filter is "LIKE Employee Code" with a trailing wildcard, a report for every employee code which matches the filter will be emailed to the addresses in the tag. To avoid this, use a filter which does not accept wildcards (e.g., equals instead of LIKE). If the internal identifier is available in the report design, pass it to the "equals" filter using the Value keyword:
' ' +
' Value="' + {GroupAnalysis.Employee_PREmployee} + '" />' +
' ' +
If only the code is available, pass it using the Code keyword:
' ' +
' Code="' + {GroupAnalysis.Employee_Code} + '" />' +
' ' +
Special formulas which affect the email dialog:
- @ActivityEmailTag - When this formula is present, the "Use Activity Email Tags" option in the Report Email Options popup is selected by default.
- @ActivityEmailBodyText - The text of the formula is used as the default email text.
- @OutputDestination - This value is set at runtime as follows:
- Preview. The Preview button initiated the report.
- Print. The Print button initiated the report.
- Export. The Export button initiated the report.
- Email. The Email button initiated the report.
- Email Tags. This option causes a special pass to look for ActivityEmail tags before the report is emailed. The special pass collects all the tags in the report. After the special pass, the report is run once per tag, applying the filter in each tag.
Note
Put the ActivityEmail tag in its own section in the body of the report. Show the tag section only when OutputDestination is "Email Tags" (and perhaps, for troubleshooting purposes, when it is "Preview"). Suppress all the non-tag sections when OutputDestination is "Email Tags" to improve the performance of the tags pass.