To download NI software, including the products shown below, visit ni.com/downloads.
This example plug-in allows you to automatically print your test reports after they are generated, or create a PDF of each generated reports.
After generating a test report, it is a common requirement to print a hard copy of the report or generate a single file version of the report, such as a PDF, for archival. This example plug-in provides these functions and can be used to process reports generated by the default or modified versions of the report generation plug-in. It can also be modified to process reports generated by custom plug-ins.
General Functionality
In order to obtain all generated reports, the plug-in uses the Parameters.ModelPluginConfiguration property in the Model Plugin - UUT Done callback sequence. This property contains an array of all active plug-in instances, allowing the print plug-in to find all active report generators. The plug-in iterates through specific runtime variables to obtain all report objects managed by the plugin (Refer to the code for specific details). Before converting a report, the plug-in uses the MSXML library to render XML reports into HTML.
Generating PDFs
The plug-in utilizes the wkhtmltopdf.exe PDF converter to process report files. A version of this tool is included with the plug-in, and later versions can be downloaded at https://wkhtmltopdf.org/. If you download another version, you can replace the included .exe file with the downloaded one.
Known Issues
Printing Reports
The plug-in uses a webBrowser .NET control to print the report files. Based on the plug-in options, the print command will use the default printer or prompt the user to select a printer for each report.
Legacy Example (TestStand 2010 and previous)
For TestStand versions earlier than TestStand 2012 that do not support plug-ins, use the legacy example. This example provides a sequence file containing two sequences that first converts an XML report to an HTML file, if necessary. It then uses the Internet Explorer ActiveX server to print the HTML report. This pair of sequences will print all four types of TestStand reports and is configurable to only print when desired. These sequences have been designed with modularity in mind so that they should be able to be taken in their current form and placed in any process model that generates test reports
Print Report Plug-in - TS2012.zip
TestStand 2012 SP1 or compatible
(recommended for viewing source code) Microsoft Visual Studio 2010 or compatible
PrintingSupport - TS4_2.zip
TestStand 4.2.1 or Compatible
LabVIEW 2009 or Compatible
Starting with TestStand 2019, there is an option to generate a PDF report.
Additional-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
In TestStand 2014 I don't see "Print Report Plugin" when clicking Insert New. I have:
Generate Report
Log to Database
Store Results for Offline Processing