NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StyleSheetPath

Solved!
Go to solution

Using the ReportOptionsCallback I attempt to set the style sheet as:

 

Parameters.ReportOptions.StyleSheetPath = "c:\temp\xyz.xsl", running the sequence containing the callback fails to set the correct path.

 

From within the sequence and not using the callback the style sheet is specified as:

 

RunState.Report.StyleSheetPath = "c:\temp\xyz.xsl", which correctly displays the generated report using the specified style sheet.

 

Why doesn't the reportoptions callback correctly change the style sheet.

 

I am using TestStand 4.1.1

0 Kudos
Message 1 of 11
(4,458 Views)

Hi,

 

Are you trying to run the sequence ReportOptions on its own?

 

If you are then this is not the correct way to use this as it will not change the static versions of the ReportOptions.

 

The use of the ReportOptions in a client sequence file is to override the default ReportOptions found in the Process Model sequence file. This allows for the runtime values to be modified not the static values.

 

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 11
(4,435 Views)

Ray,

The call back is being used as intended, as the filename of the report is also being changed successfully by the same callback sequence, hence my question regarding why the stylesheet path would not change.

 

Also the step which works should be RunState.Execution.Report.StyleSheetPath = "xyz.xsl", sorry about that.

 

 

The project I am working on is a test/simulation/traing system and I need to generate different reports hence the need to change the stylesheet dynamically, depending on the mode.

 

 

0 Kudos
Message 3 of 11
(4,414 Views)

Hi sma,

 

Can you post an example highlighting your problem.

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 4 of 11
(4,409 Views)

Ray,

I have attached a sequence file and the three referenced style sheets to demonstrate the problem.  The paths to the respective stylesheets will need to be modified to suit your environment.

 

If I skip the statement in main the style sheet used is the operating_report.xsl as this style sheet is the default via the report configuration menu option.

 

If the skip is removed the Training_Report.xsl file is used.

 

If the ReportOption callback worked the style sheet should be Testing_Report.xsl.

 

Thanls for your help.

 

 

Download All
0 Kudos
Message 5 of 11
(4,405 Views)

sma,

 

In your ReportOptions callback, the path to your stylesheet only has single backslashes, unlike the path to your stylesheet in MainSequence.  What happens if you double the backslashes on the path to your stylesheet in the ReportOptions callback?

Eric B.
National Instruments
0 Kudos
Message 6 of 11
(4,389 Views)

Hi sma,

 

Eric seems to be correct in that if you use double backslashes your style sheet is found.

 

Although, if you stop in the ReportOptions and look at the contents of Parameters.ReportOptions.StylesheetPath before you change it, it doesn't have double backslashes and yet the default works.

 

It seems to get over written in the Process Model at Setuup Report Display and get set back to the default value.

 

I'm not sure how filling RunState.Execution.Report.StyleSheetPat works as this property doesn't appear to exist!!

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 7 of 11
(4,379 Views)

Eric,

The use of \\ instead of \ in the path string makes no difference.

 

 

Ray,

The StyleSheetPath does appear as an element of the report object accessed from RunState.Execution.Report, I created the statement interactivly by working down the runstate, execution, report entries in the expression tree presented by TestStand.  Also this method comes from an example contained in this discussion forum.

 

I have access to separate installations of Labview 8.6 and TestStand 4.1.1 and both replicate this behaviour

0 Kudos
Message 8 of 11
(4,373 Views)

Ray,

Have traced the sequence in question and have found that the call to RecomputeStyleSheetPath in ReportGen_XML.seq is what is changing the report style back to the station default.

 

I've tried using double quotes but this has no effect so I don't know why it can't find the in the RecomputeStyleSheetPath using the FindFile function used in this sequence.

 

0 Kudos
Message 9 of 11
(4,358 Views)
Solution
Accepted by topic author sma

Further information regarding this problem:

 

Tracing down to the FindFile call in RecomputeStyleSheetPath, the file name used as the FindFile input parameter is ReportOptions.RelStyleSheetPath with the output using ReportOptions.StyleSheetPath

 

As the RelStyleSheetPath is set to the default file (set via ReportOptions) and it is always found via the search directories the output ReportOptions.StyleSheetPath is overwritten with the complete path of file referenced by RelStyleSheetPath.

 

I think this is may be a bug as if the relative path is specified by the reports option setting a different part of the RecomputeStyleSheetPath is used.  If it is not a bug then to dynamically change the StyleSheetPath you need to use RelStyleSheetPath member of the report option.

 

Using the RelStyleSheetPath in the ReportOptions callback results in the style sheet changing as required.

Message 10 of 11
(4,346 Views)