NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically transform xml report using Labview

Solved!
Go to solution

I want to transform the standard xml report from Teststand into a more user-friendly file format for users that need to view reports, but don't have access to the test station.  Check out the attached code.  It should work, but I get this error. "Objects of type 'Script2' do not have such a member"  'Script2' is referring to the msxsl:script javascript node in the Teststand horizontal.xsl stylesheet. 

Message 1 of 10
(7,337 Views)

Hi kwkengineer,

 

It looks like the attachment did not go through. Could you attach it again?

Evan See
National Instruments
0 Kudos
Message 2 of 10
(7,302 Views)

Not sure why it's not adding attachment.  So here is a screenshot.

Capture.PNG

0 Kudos
Message 3 of 10
(7,290 Views)

Hi kwkengineer,

 

If this is something you need for previously made reports, you can use XMLPack to package everything up to give to the users, so it will have the XML stylesheets There is more information in this KB (How Do I View TestStand XML Report Files on Another Machine). 

 

If you want to generate an HTML report for every test you run, you can add another instance of the report plugin to the result processing screen and configure it to generate an HTML report (report format options). This way you will already have the HTML reports and won't have to convert an XML file. This won't work on existing reports, but it's a good option moving forward.

Evan See
National Instruments
0 Kudos
Message 4 of 10
(7,262 Views)

I was hoping to put something together for both purposes.  The XMLPack tool is ok, but it would be better if you could just point to a folder and recursively pack all subfolders.  The other downside for me is you still end up with an XML file and the need for a stylesheet.

 

I was unaware you could setup multiple types of report outputs.  So I’ll give that a try.

0 Kudos
Message 5 of 10
(7,232 Views)

I still think transformming the existing XML is my best option.  That HTML report is fugly.  Since it is so different from my existing reports, my users will not be happy with it.  Also I've customized the xml report and don't wish to customize the html report.

Message 6 of 10
(7,210 Views)

I agree with kwkengineer.  The HTML report is fugly... haha.  You can change the colors but I still don't like the format.

 

kwkengineer,

 

I was actually trying to do the same thing as you.  We have customized our style sheet and now people are complaining because they need it and the xml file to view it.  I also don't want to rewrite the HTML generation.  I might welcome the task if we were using the new version of TestStand with plugins but we aren't, and it's too expensive to upgrade right now.

 

I do know that if you right click on the report in the viewer and choose "view source" you will get an html output of your xml report.  So my question is, and I dig around some more because I've only spent about an hour on this, how does the viewer in TestStand translate the xml report to the html one that is displayed in it.  I noticed there is a TempReport.html in the report folder.  However, it disappears when you close the finished execution.

 

Not sure if any of this is helpful but I will spend some more time routing around.

 

Regards,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 10
(7,208 Views)
Solution
Accepted by topic author kwkengineer

Well i was just busy with the same issue. 

I have made a VI that transforms an XML into a HTML.

Input: the XML and the Stylesheet path, outputs a HTML into the same folder.

 

Made in Labview 8.5.

 

I only tested this with horizontal.xsl, as this is the format I always use.

Message 8 of 10
(7,191 Views)

Awesome!  I had to change from using the dll calls to the Write To Text file primative, but it works perfectly. Thanks!

Message 9 of 10
(7,175 Views)

Glad to help.

I didn't think about using the standard VI's, I also changed my VI now according to your hint.

0 Kudos
Message 10 of 10
(7,170 Views)