Return to site

Custom Stylesheets for TestStand XML Reports

· TestStand,reports,XML

Recently, I responded to a question on the NI TestStand forum about adding a line to the header of an XML test report. The user added one line to the ModifyReportHeader callback and then in my response, I informed him that to see the new information, some 15 lines of text needed to be added to the stylesheet.

So how does this work? I had to explain this to a manager last year. When creating the test report, TestStand creates an XML file. However, the TestStand XML file calls out another file, called a stylesheet, which formats all of that data into an HTML file, which can then be displayed in a browser (in a much more readable format). So if you want to distribute a TestStand XML report, you also have to ensure that the recipients have the stylesheet file in the right location, or else, when they try to open it, they'll only see the raw XML.

In comparison, text files (CSV, tab delimited, etc.) are much easier to create (just add one line to your TestStand callback). They're also (usually) human readable from the start. However, they're not very extensible. For example, your second generation report may add lines to the header. If your parser is looking at the number of rows (don't do this), then everything will be messed up. With XML reports, you can add as much as you want and your parser should still behave the same way.

Also, the XML reports with a stylesheet just generally look better. You can put everything in table format and add your company logo (clients love this). I think an underrated feature is just the ability to put certain report text in bold.

Personally, I have never actually used ATML. It looks like there are definitely some advantages so I'll have to look at that in the future.

All Posts

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly