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

Generating a New Excel Report Each Time VI Runs

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:

This VI will create and save multiple Excel reports by programmatically generating different paths.


Description:

This example demonstrates how to programmatically create a set of Excel Reports. Each report will have a base name chosen by the user and a number based of the initial report number.

The Generate_Excel_Report.vi contains a while loop in which a report is opened, data is written to it, and closed. With each iteration of the loop, a different report will be created and its name will depend on the Initial Report input and iteration number. The Generate_Excel_Report_Build_Path simply takes in the base information from the user and appends the iteration number to the initial report to create a path for the Save Report To File.vi.

Some uses for this example include saving large amounts of data that would be too large to handle at once, or opening and closing files after a certain amount of time.


 Requirements: LabVIEW 2012 (or compatible), Report Generation Toolkit. Hardware: none.


 

Step to Implement or Execute Code:

  1. Chose a folder to store the reports.
  2. Write in a base name for these reports.
  3. Establish the initial report number.
  4. Run the VI.

Additional Information or References:

 

Generating a New Excel Report FP.png

 

Generating a New Excel Report BD.png


**This document has been updated to meet the current required format for the NI Code Exchange.**

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support

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

Comments
Audrey Patarroyo
Member
Member
on

Buenas noches, estaba realizando este ejemplo y no encontre el icono para agregar el "new path"

Gracias de antemano

Samgut
Member
Member
on

New Path, según lo que yo veo ahí, es un SubVI creado por el usuario para ir cambiando el nombre cada vez que se ejecuta el VI. No es un SubVI que encuentres en las paletas; debes crearlo.