Adding a Custom Header to a TestStand HTML Report

Updated Jun 5, 2023

Environment

Software

  • TestStand

Custom headers can be added in TestStand reports if necessary by the user. This article will go through how to add custom headers to an HTML report using the ModifyReportHeader Callback.

In order to add the custom header, you need to have the sequence open and follow the next steps: 

1. Right-click in the Sequences pane and select Sequence File Callbacks...
2. Select the ModifyReportHeader Callback, then click Add.
3. Click OK to dismiss the dialog. Notice that a new ModifyReportHeader sequence has been created in the Sequences pane. 
4. Select the ModifyReportHeader sequence. Notice that the ModifyReportHeader contains the ReportHeaderPrefix parameter, as shown below.
 

 
4. Add a statement step to dynamically change the value of the ReportHeaderPrefix, there is where you are going to add your custom header, you can use HTML5 and CSS tags to change the appearance of the header. For example, this expression creates a header with the word "Classified" in red:

Replace (Parameters.ReportHeaderPrefix,0,0,  "<h1><center><code style='color:red;'>Classified</code></center></h1>")

 
 

Once you have completed the steps above, run the sequence and the report header will look as shown below.