From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Append Image to Excel & Set Location Using Report Generation

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to append an image at a specified position with Excel, Word or HTML reports.

 

Description

The LabVIEW Report Generation Toolkit for Microsoft Office is a library of flexible, easy-to-use VIs for programmatically creating and editing Microsoft Word and Excel reports from LabVIEW. Whether you need to generate reports summarizing manufacturing test results or compile process statistics to improve your production yields, the LabVIEW Report Generation Toolkit speeds development of customized, professional reports. Create custom reports in even less time using the new Microsoft Office Report Express VI.

 

The example shows how to add an image to a Report generated with LabVIEW (possible formats: Microsoft Word, Microsoft Excel, HTML).

Depending on the output format the image can be placed at a certain cell (Excel) or a certain bookmark (Word). For HTML the placement is dependent on the order of the elements added to the HTML formatted report.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • LabVIEW 2012 Report Generation Toolkit (included in LabVIEW Professional since version 2014)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Select the tab for the desired report type
  3. Read the comment inside the tab and configure settings if applicable
  4. Run the VI 

 

Additional Information or References

Append Image to Report - Front Panel.png

 

Append Image to Report - Block Diagram.png

 

Since LabVIEW 2014 the Report Generation Toolkit is already included in the LabVIEW Professional Development System license.

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.