In addition to using options to determine the names and locations of report files, you can specify a custom expression with predefined macros TestStand evaluates at run time for each UUT to fully customize the filename of reports and the directory in which TestStand stores reports. For example, you can use expressions to save reports in a directory that uses the sequence filename, save reports in different directories based on execution status, and generate report filenames that include the serial number, user name, or execution status.

You can use expressions to replicate all existing report filename options. Use the Report File Pathname tab of the Report Options dialog box to specify an expression for a report.

The following table lists common report options and the equivalent expression for the Sequential process model using the client sequence file directory as the base directory.

Current Report Option Equivalent Expression
New UUT Report File for Each UUT $(ClientFileDir)\\Report_$(UUT).$(FileExtension)
Prefix Sequence File Name to Report File Name $(ClientFileDir)\\$(ClientFileName)_Report.$(FileExtension)
Add Date and Time to File Name $(ClientFileDir)\\Report_$(FileDate)$(FileTime).$(FileExtension)
Force File Name to Be Unique $(ClientFileDir)\\Report_$(Unique).$(FileExtension)
Prefix Sequence File Name to Report File Name + New UUT Report File for Each UUT + Add Date and Time to File Name $(ClientFileDir)\\$(ClientFileName)_Report_$(UUT)_$(FileDate)$(FileTime).$(FileExtension)

The following table lists example expressions for common tasks using the Sequential process model.

Task Equivalent Expression
Save reports in a directory that uses the sequence filename C:\\$(ClientFileName)\\Report.$(FileExtension)
Note TestStand overwrites existing files unless you use the $(Unique) macro or enable the Append if File Already Exists option on the Contents tab of the Report Options dialog box.
Save reports in different directories based on execution status C:\\$(ClientFileName)\\$(UUTStatus)\\Report.$(FileExtension)
Note TestStand overwrites existing files unless you use the $(Unique) macro or enable the Append if File Already Exists option.
Generate report filenames that include the UUT serial number C:\\$(ClientFileName)\\Report_$(UUT).$(FileExtension)
Generate report filenames that include the user name C:\\$(ClientFileName)\\Report_$(UserName).$(FileExtension)
Generate report filenames that include the execution status C:\\$(ClientFileName)\\Report_$(UUTStatus).$(FileExtension)
Note NI provides a list of supported macros you can use with expressions to customize reports. Use these macros only in the Specify Report File Path by Expression control on the Report File Pathname tab of the Report Options dialog box and not in any other TestStand expression controls.