To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI illustrates how to append a multi-page table to a Standard Report.
Description
In this example, a Standard Report is used to generate and print a report. The problem addressed was how to use the "Append Table to Report.vi" on a large table, especially one with a lot of columns. The standard behavior of the "Append Table to Report.vi" is to cram all the columns of the input table onto one page, regardless of its size.
So this example shows how to print the large table on multiple pages, with each page containing a specified number of columns. To accomplish this, the idea is to divide the table columns from the table between all the different pages, and call the "Append Table to Report.vi" on each subset of table columns.
The input to the "N" terminal of the for loop is the number of subsets that will be printed on separate pages. The increment logic is needed when the columns don't divide evenly between all the pages, and so an extra page is used to print all the spare columns.
NOTE: The logic could also be replaced with the "Divide" and "Round Toward +Infinity" VIs.
Inside the for loop, the "Array Subset" VIs use the current loop count and the "N" input to select the appropriate columns in the table to append to the Report, using the "Apend Table to Report.vi".
The case statement is used to add the page breaks so each table subset will print on separate tables.
NOTE: The "Append Table to Report.vi" has an input titled "separate page?" which causes the table to be printed on a separate page, but the page break it adds to the report is after the table is added. To work correctly, the page break needed to be before the table is appended to the report. This also made it easier to have text appear on the same page as the table, as in this example, the last page had a signature line added.
The rest of the VI contains code for creating the Standard Report, page and text formatting, and printing. This code is not discussed because it is beyond the scope of this example.
NOTE: When you run this example, it WILL PRINT THE REPORT.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Excellent ! A few months ago i had this same problem and your idea fits like a charm for me.