NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change report folder programmatically with an expression in Report options window.

Solved!
Go to solution

First of all I am a beginner in Teststand so apologies for any mistake.

I was trying to change folder path in Report Options window where we can specify path with expression.

But I don't want to  change the current file name which is created using Macro ($FileDate, $FileExtension)

I was not getting a specific answer to my question.

Here is the screenshot. So in Report Options dialog I want to specify folder name (Currently 'Folder1') and change it to 'Folder2' based on condition that if specific sequence runs.

 

teststandIssue.png

 

Note:

I have tried using sequence callback and creating Report Options sequence and defining the path based on expression but that does not let me access Macro in report options ( $FileDate, $FileExtension, etc..)

GCentral
0 Kudos
Message 1 of 5
(2,141 Views)

Hi LVK

 

You can specify an Expression in that box not only a pathname.  Maybe go for something like:

 

(Locals.Operator == "SercoSteveB") ? <Your Folder 1 Path> : <Your Folder  2 Path>

 

Clearly Locals.Operator == "SercoSteveB" is probably not going to work for you, but any expression that evaluates to True or False will do the trick. Smiley Wink

 

Steve

 

0 Kudos
Message 2 of 5
(2,128 Views)

@SercoSteveB wrote:

Hi LVK

 

You can specify an Expression in that box not only a pathname.  Maybe go for something like:

 

(Locals.Operator == "SercoSteveB") ? <Your Folder 1 Path> : <Your Folder  2 Path>

 

Clearly Locals.Operator == "SercoSteveB" is probably not going to work for you, but any expression that evaluates to True or False will do the trick. Smiley Wink

 

Steve

 


Thanks Steve,

I have a question here, I know how to define variables in sequence but how can I define variable (say Locals.Operator) for the ReportOptions window?

reportIssue2.png

GCentral
0 Kudos
Message 3 of 5
(2,123 Views)

We are moving into territory that I haven't been before.  If you need to switch paths based on the sequence file that was run I am not sure a Local is going to give you the scope that you need.   You could do it with a StationGlobal, but that feels like overkill (but maybe worth it to trial the method).

Message 4 of 5
(2,110 Views)
Solution
Accepted by topic author MangeshD

Hi SercoSteveB,

It make sense of using StationGlobals but I thought of creating my own file name in the format mentioned in Report options setting.

So, I managed to check for report options callback and then adding expression to check for specific sequence and creating report filename based on format specified in ReportOptions setting.

2018-03-24_1707.png

 

Thanks for your help!

GCentral
0 Kudos
Message 5 of 5
(2,020 Views)