09-22-2009 04:38 AM
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
Solved! Go to Solution.
09-23-2009 05:47 AM
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
09-23-2009 05:47 PM
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.
09-24-2009 12:45 AM
Hi sma,
Can you post an example highlighting your problem.
Regards
Ray
09-24-2009 04:25 AM
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.
09-24-2009 10:53 AM
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?
09-24-2009 03:26 PM
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
09-24-2009 06:09 PM
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
09-25-2009 10:54 PM
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.
09-26-2009 07:45 PM
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.