LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Infinite # of Columns in Append Table to Report

Solved!
Go to solution

I am in need of a bit of help here in regards to dealing with the Append Table to Report.vi

 

With this VI I can print up to a certain # of columns before the VI starts to wrap columns (& subsequent data under each column) downward in vertical manner.

 

I am looking for a way to do the following:

 

1) center the text in all columns

 

2) set a pre-set # of columns per page, and then print the remaining columns to a separate page thereafter

 

3) avoid column header & data from being folded beneath to the subsequent row

 

See the attached code and print-outs.

 

Thanks!

Download All
0 Kudos
Message 1 of 7
(3,593 Views)

There are a number of ways to accomplish the formatting you want for your report:

 

I would reccomend doing this: use the "Microsoft Office Report" Express VI.  You can create an Excel Template and format the columns the way you want.  The following link shows how to link specific columns in the excel file to LabVIEW:

http://digital.ni.com/public.nsf/allkb/F826E6FE3FC0C8E88625746600486381?OpenDocument

 

Another method would be to manually split up your table based on how many columns per page you wanted, and use multiple "Append Table to Report.vi" for each page of your report.  This could be accomplished by placing the "Append Table to Report.vi" into a while loop, and in each iteration using "Array Subset.vi" to select the columns and data to pass into the "Append Table to Report.vi".  So in summary, this method would cause each iteration of the while loop to attach a subset of your large table to the report, one for each page.

 

I hope this helps,

 

Nathan P.

Systems Engineer
SISU
0 Kudos
Message 2 of 7
(3,564 Views)

Thanks for the reply.

 

Could you drop in an example VI on the While Loop configuration you cited?

 

Also, 2 things I'm having an issue getting resolution on:

 

1) How to center the Column Headers in the table print-out

 

2) Is there a report generation sub-vi that will add a page # per each individual page?

 

Thanks.

0 Kudos
Message 3 of 7
(3,562 Views)

Will your columns static, or for your application do they need to change programatically?

Systems Engineer
SISU
0 Kudos
Message 4 of 7
(3,548 Views)
Solution
Accepted by topic author jonathanupr

Using the "Append Table to Report" VI, you can't specify center alignment, through if you enable gridlines, it makes the tables more readable.  If you were to generate an Excel report, you would have more control and be able to specify cell alignment.

 

In the Report Generation Toolkit, using Standard Report, there is no way to get or automatically print the page number.  You can do it manually by keeping track of how many pages have been printed if your using the "New Report Page" VI.  

 

Using the VI script you posted, I modified it to illustrate how to selectively add columns to the report.  Its usually not standard practice for us to write code for customers, but this example seemed good for the Community Example Page (http://www.ni.com/code/), and with your permission I'd like to post it there as well.

Systems Engineer
SISU
0 Kudos
Message 5 of 7
(3,539 Views)

Nathan thanks for the example.  Go ahead and post it in the community thread.

 

I agree that Excel is a better way to go when wanting to format specifics, but the Standard report allows all of our end-users to print regardless if they have Microsoft Office.  Most likely will start making up Excel formated reports in the future.

0 Kudos
Message 6 of 7
(3,526 Views)

I made a brief example and posted it in the NI Community.  You can find the example code here:  https://decibel.ni.com/content/docs/DOC-23161

Systems Engineer
SISU
0 Kudos
Message 7 of 7
(3,523 Views)