NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

stylesheet array syntax

Solved!
Go to solution

That is exaclty what i've done but I don't see any values printed.

[DL]
0 Kudos
Message 11 of 17
(1,457 Views)
Solution
Accepted by topic author DanielJL

After a more hours of trying different things.  I got it working.  First my userInput array was made to be a FileGlobals variable.  Then in the XSL i used the following code:

 

<xsl:value-of select="Prop[@Name='userInput']/Value[@ID='[0]']"/>

 

there seems to be only be one Prop command called.

 

Thanks for ur help!!

[DL]
Message 12 of 17
(1,452 Views)

Glad to hear you got it working.

 

That is odd that our TestStand project produced different XML formats for that variable. An easy way to check how many times you need to call Prop[@Name='userinput']/ is to look in the XML form and find how many layers down the array is. Every time you enter that command, it selects a property one layer (indentation) down in the XML form.

National Instruments
0 Kudos
Message 13 of 17
(1,443 Views)

Hi D Biel,

 

To make things a little more complicated, i'm using a calling sequence to call this userinput.seq file as a step.  When I do this, the report header information that was printed by running userinput.seq is no longer printed in the calling sequence's report.

 

any idea on how to get this to print into the header from an external calling sequence file?

[DL]
0 Kudos
Message 14 of 17
(1,411 Views)

DL,

 

Is the field for the array showing up in the report header? Or is this functionality not being called. Make sure that the array is a global variable and all the functions that use it have access to the same copy of it. Also make sure that the callback is modified in the top level sequence file. This is the sequence that is actualy going to create the report.

National Instruments
0 Kudos
Message 15 of 17
(1,396 Views)

I hate to dig up old worms with this one, but I'm struggling with a similar problem that the original poster was experiencing except, I want to display a simple string parameter to the report Header.

 

My problem is that I am trying to insert a user input "Batch Number" to the report header.  I've been reading through this post and I'll list what I've done so far:

- In "NI_ReportGenerator.seq" I've added the activeX step to the "ModifyReportHeader" callback to do the following:

  1. Automation server: NI TestStand 2012 API (Ver 1.0)
  2. Object Reference: Parameters.UUT.BatchNumber
  3. Object Class: Property Object
  4. Call Method: Get XML
  5. Return Value: Locals.XML  (Not sure of the purpose of this variable?)
  6. Generation Options: 0x95
  7. InitialIndentation: 0
  8. DefaultName: BatchNumber
  9. formatString: Parameters.ReportOptions.Format

I'm using report.xsl and here's all the code I've used to modify the header:

<tr valign="top">
                        <td class="ReportHeader" style="white-space: nowrap">
                            <span style='font-size:1.0em'>
                                <b>Batch Number:</b>
                            </span>
                        </td>
                        <td class="ReportHeader">
                            <b>
                                <xsl:value-of select="Prop[@Name='BatchNumber']/Prop[@Name='BatchNumber']/Value"/>
                            </b>
                        </td>
                    </tr>

I can see the Batch Number row is added to the Report header but my variables were not passed to the header and I'm wondering if you all could see the issue I'm having?

 

Thanks,

 

-Bill

John 3:16
0 Kudos
Message 16 of 17
(1,200 Views)

Gentlemen,

 

Well I guess I didnt need to dig up the old worms, I found the issue was misinterpretation on my part...so for anyone else with this issue searching the forums I'll try and show how the problem was solved.

 

First I suggest reading "How to Modify a TestStand XML Report Header" Document ID: 5ADH53GU, this is where I found the right path.

 

So i added a new UUT parameter "BatchNumber" and I wanted to pass it to my report header, therefore I went into NI_ReportGenerator.seq (archive copies of the original file...always a good practice) and Added the expression "Parameters.ReportHeader += Parameters.UUT.BatchNumber.GetXML(XMLOption_NoOptions, 0, "BatchNumber", Parameters.ReportOptions, NumericFormat) to the "ModifyReportHeader" callback.

 

Now to add lines to report.xsl:

					<tr valign="top">
						<td class="ReportHeader" style="white-space: nowrap">
							<span style='font-size:1.0em'>
								<b>Batch Number:</b>
							</span>
						</td>
						<td class="ReportHeader">
							<b>
								<xsl:value-of select="//Report/Prop[@Name='BatchNumber']"/>
							</b>
						</td>
					</tr>

 

This should do the trick.

John 3:16
0 Kudos
Message 17 of 17
(1,184 Views)