NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Add a string result to a report on step failure

Hi All!

 

I have a step that processes a long string report.

 

If the step fails, I would like to include the text from the script output, which is about 100 lines.  So I don't want it every time.

Would it be better to just have a blank txt field that I load with the output with a post expression?  Or is there a better way to toggle on/off?

0 Kudos
Message 1 of 2
(1,017 Views)

You could just use the common Step.Result.ReportText field and use a ternary to specifiy whether to set it.

 

Step.Result.ReportText = (Step.Result.Status == "Passed") ? "" : "Your Text Information"

 

If ReportText is empty it won't appear on the report, and if you put information it will appear.

Message 2 of 2
(973 Views)