NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating two reports with different steps recorded using ResultRecordingOption

Solved!
Go to solution

Hi everybody, 

 

I am generating 2 reports with TestStand: 

- One is a csv generated thanks to a plug in based on Simple Text Report that I modified to correspond to my needs. This one is used to be a log file, reporting all actions in the sequence.

- And the second one is the "real" report, configured within the Result Processing -> Report window. 

 

I want my log file to have all the information of all steps of the sequence and I want to let the user Enabling or Disabling the steps he wants in the real report with Result Recording Option. 

 

The problem is that Result Recording Option : Disabled does not populate the ResultList, which is used as well by the Simple Text Report Plug in that I modified. So, the step does not appear in the report, which is nice, but does not appear in the log file.

 

Is there a way to have 2 different reports with different steps recorded ?

 

I found a conversation about it : Two reports with different steps recorded - NI Community,

but I didn't really found what I was searching for in the answer. 

 

Thanks a lot in advance for your answer !

0 Kudos
Message 1 of 5
(137 Views)

Report generation uses the ResultList variable as a datasource.

Everything which is not in there can't go into a report.

Disabled steps are not executed, hence they don't add anything to the ResultList.

 

In general, you can implement a lot of extra stuff going off-standard, but this comes at a price in terms of complexity and maintainability.

 

What is the purpose of logging information for steps which are not executed?

0 Kudos
Message 2 of 5
(134 Views)

Dear Oli_Wachno, 

 

My first report act as a log file, that's why I want all information of all steps executed in the sequence in it. The second one, the real report, needs to display some steps, defined by the user one by one. I cannot use ResultFiltering method for example, as it really depends which step the user wants. That's why ResultRecordingOption was interesting : for each step the user could select if he wants to display it in the report or not. The problem is that it affects the log, supposed to write everything in the file...

 

Thanks for your answer !

0 Kudos
Message 3 of 5
(127 Views)
Solution
Accepted by topic author alTLS

Step ResultRecordingOption set to Disabled will cause the step result to not be included in the ResultList.

To handle your case you need to add a Property to the Step.Result in the PreExpression.  Then this property can be used to do ResultFiltering in the Report Options.

 

When the user does not want the step in the report add this to pre-expression:

eejallen_0-1733340457406.png

Step.Result.SetValBoolean("ShowInReport", PropOption_InsertIfMissing, False)

 

Then, go to Report Options and set a custom filter:

eejallen_1-1733340529412.png

Result.Exists("ShowInReport", 0) ? Result.ShowInReport == True : True

 

Please note:  All steps that might be filtered by the new property will need ResultRecordingOption set to Enabled

0 Kudos
Message 4 of 5
(83 Views)

Thanks a lot, this solution works for my needs !

0 Kudos
Message 5 of 5
(59 Views)