Adding Custom Data to a Report

Purpose

You must complete the following tasks to add additional data to a report:

  • Configure the desired property to be logged as a result. Results are stored in the Locals.ResultList array.
  • Configure the result to be added to the report. This is typically accomplished by enabling the \IncludeInReport\ flag.

This example demonstrates the following approaches for adding custom data to a report:

  • Using the UUT.AddtionalData container to add data to the report header
  • Using the API method Execution.AddExtraResult
  • Creating a custom property and setting the IncludeInReport flag
  • Creating a custom step type with custom properties in the Step.Result container
  • Using the Additional Results step type or property setting

Example File Location

<TestStand Public>\Examples\Customizing Result Processing\Adding Custom Data To a Report\Adding Custom Data To a Report.seq

Highlighted Features

  • TestStand API
  • PreUUT Callback
  • Custom step types

Major API

  • Execution.AddExtraResult
  • PropertyObject.SetValString
  • PropertyObject.SetFlags

Prerequisites

None

How to Use This Example

Complete the following steps to run the example:

  1. Select Execute»Single Pass to execute the sequence.
  2. As the example executes, read the message popups for information about each method demonstrated.

Complete the following steps to review the sequences and steps in this example.

  1. Select the PreUUT Callback in the sequences pane. Note that the statement steps create new properties in the Parameters.UUT.AdditionalData container, which will appear in the report header. The PropertyObject.SetFlags method is used to configure the property to display in the report.
  2. Select the AddExtraResult sequence. This sequence calls the Execution.AddExtraResult method to add the Step.MessageExpr property to the Result list. For the property to appear in the report, the IncludeInReport flag must be enabled for this property.
  3. Select the CustomProperty sequence. This sequence uses the PropertyObject.SetValString method to create a new property in a Numeric Limit Test step. The sequence then calls PropertyObject.SetFlags to enable the IncludeInReport flag for the new property so that it is displayed in the report.
  4. Select the CustomStepType sequence. This sequence calls a step type which has an additional property in the results container. The IncludeInReport flag for this property is enabled in the step type definition, so you do not need to enable it for each instance of the type.
  5. Select the AdditionalResults sequence. This sequence uses the Additional Results step to log additional data to the report. It also uses the Log option for parameters in the Calculate Area of Circle code module to log the parameter values