Generate PDF Reports Using the LabVIEW Report Generation Toolkit

Updated Dec 9, 2020

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Operating System

  • Windows

Other

  • Microsoft Office

Issue Details

I am using the LabVIEW Report Generation Toolkit with Microsoft Excel and Word. How can I save my reports in PDF format?

Solution

This article describes different methods to save the Microsoft Excel and Word reports as PDF files by using the LabVIEW Report Generation Toolkit. It also proposes another alternative using a third-party add-on in LabVIEW.
 

1. Using ActiveX References

This method uses ActiveX references and the ExportAsFixedFormat method to export a Word document or Excel worksheet as a PDF file. The example code is configured to open the PDF file immediately after created. If you do not want to open the PDF file, you can change the OpenAfterExport and OpenAfterPublish boolean constants to FalseNote: this method does not work with HTML reports.


 

2. Using PDF Printer Software

This method uses a third-party PDF printer software in combination with the Print Report VI from the LabVIEW Report Generation Toolkit to generate the PDF file. This method prompts the user to select the directory where the PDF file will be saved. Note: the example code requires the CutePDF Writer software, but can be modified to use similar tools.


 

3. Using LabVIEW Add-Ons

Another alternative is to use third-party add-ons in LabVIEW such as Custom PDF Generator for LabVIEW. Note: this product is supported by the third party and not by NI. For technical support, contact Simplicity AI.

Additional Information

The file, LabVIEW PDF Reports.zip, under the Attachments section contains the example code used in this article. To run the code, you need the LabVIEW Report Generation Toolkit and Microsoft Office installed on your computer.