NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Parameters.ReportOptions by expression

Solved!
Go to solution

I'm testing five UUTs with the batchmodel.

Now I want to save the UUT reports to "c:\\test\\<UUT>_<UUTStatus>_<Unique>".

 

Therefor I've added the expression to the sequence "ReportOptions":

Parameters.ReportOptions.DisableReportGeneration = False,
Parameters.ReportOptions.IncludeStepResults = True,
Parameters.ReportOptions.AppendToFileIfItExists = False,
Parameters.ReportOptions.Format = "html",
Parameters.ReportOptions.BodyGenerator = "Sequence",
Parameters.ReportOptions.BaseName = "",
Parameters.ReportOptions.DirectoryType = "SpecifyByExpression",
Parameters.ReportOptions.ReportFilePath = "c:\\test\\<UUT>_<UUTStatus>_<Unique>",
Parameters.ReportOptions.GeneratePath = False,
Parameters.ReportOptions.IncludeTimes = False,
Parameters.ReportOptions.DateAndTimeFormat = "DateFirst",
Parameters.ReportOptions.NewBatchFileNameForEachBatch = False

 

Now I get the following error:

Details:

An error occurred calling 'Save' in 'Report' of 'NI TestStand 2010 API'
Value invalid or out of range.. Error writing to file 'c:\test\<UUT>_<UUTStatus>_<Unique>.html'.

 

Error Code:

-17300; Value invalid or out of range.

 

Location:

Step 'Write Batch Report' of sequence 'Test UUTs' in 'BatchModel.seq'

 

What am I doing wrong? I've searched and tried a several thinks, but I can't find what goes wrong.

0 Kudos
Message 1 of 19
(5,808 Views)

The Parameter.ReportOptions you should be using is

 

BatchFileBatchModelExpression

ReportFileBatchModelExpression

 

not ReportFilePath

 

with

 

DirectoryType = "SpecifyByExpression"

 

 

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 19
(5,784 Views)

Thank you for your answer, but I still got a problem. I've changed the expression to:

Parameters.ReportOptions.DisableReportGeneration = False,
Parameters.ReportOptions.IncludeStepResults = True,
Parameters.ReportOptions.AppendToFileIfItExists = False,
Parameters.ReportOptions.Format = "html",
Parameters.ReportOptions.BodyGenerator = "Sequence",
Parameters.ReportOptions.BaseName = "",
Parameters.ReportOptions.DirectoryType = "SpecifyByExpression",
Parameters.ReportOptions.GeneratePath = False,
Parameters.ReportOptions.IncludeTimes = False,
Parameters.ReportOptions.DateAndTimeFormat = "DateFirst",
Parameters.ReportOptions.NewBatchFileNameForEachBatch = False,
Parameters.ReportOptions.BatchFileBatchModelExpression = "",
Parameters.ReportOptions.ReportFileBatchModelExpression = "c:\\test\\<UUT>_<UUTStatus>_<Unique>"

 

And now I get the following error:

 

Details:

Parameter 'newValue': Error in argument 2, 'Find(Parameters.ReportFilePath, "\\", 0, True, True)', in call to the expression function 'Left'.
The parameter which evaluated to -1 cannot be negative.

 

Error code:

-17300; Value invalid or out of range.

 

Location:

Step 'Set Temp File Directory Path' of sequence 'Setup Report Display Settings' in 'ModelSupport.seq'

 

Parameters.ReportFilePath contains ".html", so I think it is using the incorrect parameter for the ReportFilePath.

 

How can I force to use "ReportFileBatchModelExpression" in stead of "ReportFilePath"? I thougth this would be done by:

DirectoryType = "SpecifyByExpression", but this isn't working, do I have another incorrect setting?

0 Kudos
Message 3 of 19
(5,783 Views)

Hi,

 

you need to set

 

Parameters.ReportOptions.GeneratePath = True

 


 

Regards
Ray Farmer
0 Kudos
Message 4 of 19
(5,770 Views)

Hello Ray,

 

 

I've tried it, but now it has a problem with the colon in the path. Which is very strange, because you can't have a path without a colon in it.

 

Is there a document which describes the options of "Parameters.ReportOptions.*" ? And/or is there an example of the thing which I am trying?

 

Or is it possible to convert the settings in "Configure -> Report Options..." to an expression?

 

 

Best regards,

 

 

Niek

0 Kudos
Message 5 of 19
(5,769 Views)

I dont see your problem.

 

I used your settings as you posted with the adjustment for Parameters.ReportOptions.GeneratePath and it works fine.

 

 

 

Regards
Ray Farmer
0 Kudos
Message 6 of 19
(5,765 Views)

I've tried a lot, but I still cann't get it running. I've attached a very simple test project. Maybe you can try to run it?

I use the batch model.

 

Thanks in advance,

 

Niek

0 Kudos
Message 7 of 19
(5,735 Views)

I have opened your sequence file and I dont see any ReportOptions sequence. In fact there is nothing other than the MainSequence which contains no steps.

Regards
Ray Farmer
0 Kudos
Message 8 of 19
(5,726 Views)

The Workspace contains a sequence file named "test_logging.seq", which contains the "ReportOptions" sequence.

This sequence contains a step named "Force Repoert Generation". See the attached screenshot.

 

It is correct that the MainSequence contains no steps, because I only want to test the generation of the report.

 

Best regards,

 

Niek

0 Kudos
Message 9 of 19
(5,719 Views)

shouldn't you be using Expressions in your path string

 

Parameters.ReportOptions.ReportFileBatchModelExpression = "c:\\test\\<UUT>_<UUTStatus>_<Unique>"

Regards
Ray Farmer
0 Kudos
Message 10 of 19
(5,713 Views)