NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

modify report header

Hello,

I need to display custom information on my xml report header. To be specific, I am trying to display the for loop count on the report header. 

Any ideas on how to do this?

Thanks a lot in advance!

0 Kudos
Message 1 of 11
(5,837 Views)

Hey nikk07,

 

There are a couple of ways we can do this. The changes need to be made to the test sequence to save the value of a given variable to the generated XML file. You can use ModifyReportHeader callback to make the changes.

  1. In your sequence file, add a callback by right-clicking in the Sequences pane and selecting Sequence File Callbacks...  Add ModifyReportHeader from the list and close the dialog.
  2. In the new ModifyReportHeader sequence, add a new Local variable called CustomText.  The value of this variable will be the new value added to the report, so give it a meaningful value such as "My New Report Text".
  3. The last step is to generate XML from the new variable and append this to the Parameters.ReportHeader XML already passed into the callback.  When ModifyReportHeader starts, the Parameters.ReportHeader string contains the XML that was generated by the default TestStand reporting in the specified process model.  We can append to this to add more data to the XML file for use in the second section of this article.  To do this, use the following expression:  Parameters.ReportHeader += Locals.CustomText.GetXML(XMLOption_NoOptions, 0, "CustomText", Parameters.ReportOptions.NumericFormat).  The GetXML function takes information about a PropertyObject and turns it into a properly-formatted XML string.  See the TestStand help on this function for more information.

I found these steps in this KnowledgeBase Article: 

 

http://digital.ni.com/public.nsf/allkb/17ABBD0BF2A60D908625774200798869

 

and found this example:

 

https://decibel.ni.com/content/docs/DOC-12617

 

You may also want to read through the Best Practices for TestStand Report Generation and Customization. There is a lot of good information in that article that may come in handy down the road.

 

http://www.ni.com/white-paper/8289/en

 

Best Regards,

 

-KP

Kurt P
Automated Test Software R&D
0 Kudos
Message 2 of 11
(5,805 Views)

Kurt,

Thank you! I tried that method earlier but I could not make it generate my new text. For the third step, I inserted a statement in the ModifyReportHeader sequence and added the expression "Parameters.ReportHeader += Locals.CustomText.GetXML(XMLOption_NoOptions, 0, "CustomText", Parameters.ReportOptions.NumericFormat)"  in Expression in the step settings pane.

Can you please tell me if I am doing anything wrong there?

Thanks again!

0 Kudos
Message 3 of 11
(5,802 Views)

Hey nikk07,

 

Did you make the modifications to the horizontal.xls file? You need to do this within the .xls file located in 

 

C:\Program Files (x86)\National Instruments\<TestStand Version>\Components\Models\TestStandModels\StyleSheets

 

I recommend making a file called horizontal_original so you have one to go back to before you start editing it. Also, you need to open the file with administrative privileges in order to edit it. Also, make sure the statement is in the ModifyReportHeader callback. 

 

This may come in handy later. It is the help file on stylesheets and give a lot more information to what is in the file:

 

http://zone.ni.com/reference/en-XX/help/370052H-01/tssuppref/infotopics/report_stylesheets_details/

 

Best Regards,

 

-KP

 

Kurt P
Automated Test Software R&D
0 Kudos
Message 4 of 11
(5,773 Views)

Kurt,

Yes I modified that as well. I inserted the following  statement, 

                       <font face = "VERDANA" size = "4" color= "#003366">
                                  <xsl:value-of select="//Report/Prop[@Name='CustomText']"/>
                       </font>

I inserted that right after the statement:

 <font face = "VERDANA" size = "4" color= "#003366">

 </font>

 

It still did not work. 

 

Here I have attached what I've got so far.

Thanks!

0 Kudos
Message 5 of 11
(5,749 Views)

That sequence makes the same calls that mine does so the problem must lie within xls file or the station options. 

 

Is there any report being generated from the test?

Just to verify, can you paste the directory the .xls file is found in?

What version of TestStand are you using?

 

Try the version of horizontal.xsl I attached and let me know if it works. You will need to extract it first.

Kurt P
Automated Test Software R&D
0 Kudos
Message 6 of 11
(5,727 Views)

This is the file path of the location the horizontal.xsl file is saved in my computer.

C:\Program Files\National Instruments\TestStand 2010\Components\Models\TestStandModels\StyleSheets

 

There is a report being generated, but it does not display my new text.

 

I am using TestStand 2010.

 

And I tired it with the file you attached, but still did not work.

 

Thanks again.

0 Kudos
Message 7 of 11
(5,723 Views)

nikk07,

 

Here is everything that I have made to make this work (in the attachment). I have a few more ideas, lets put a breakpoint in the ModifyReportHeader statement just to make sure we hit it. I did this in TestStand 2010 4.5.1. I included my report as well so you can see what it looks like. Also can you double check the the horizontal.xsl file is edit? There were a few issues I ran into with permissions when I was trying to edit the file, maybe there is something blocking the file from being altered. Lastly what is the process model set to on your station? Mine is using the SequentialModel.Seq. 

Kurt P
Automated Test Software R&D
0 Kudos
Message 8 of 11
(5,690 Views)

 

So it turns out that my modify report header callback does not work as expected when On the fly report generation option is enabled. I read another thread about that problem here.

http://forums.ni.com/t5/NI-TestStand/Header-does-not-get-modified-when-on-the-fly-optione-enabled/m-...

Thanks a lot for your help!

0 Kudos
Message 9 of 11
(5,647 Views)

Thank you for posting what was happening, just in case anyone else runs into the same issue. This is also good for me to note that on the fly reporting disables this kind of callback. Thanks again for the knowledge. 

 

Best,

 

-KP

Kurt P
Automated Test Software R&D
0 Kudos
Message 10 of 11
(5,624 Views)