07-03-2012 01:47 PM
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!
Solved! Go to Solution.
07-06-2012 03:12 PM
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.
07-06-2012 04:33 PM
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.
07-09-2012 09:42 AM
Will your columns static, or for your application do they need to change programatically?
07-10-2012 04:36 PM
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.
07-11-2012 10:40 AM
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.
07-11-2012 12:41 PM
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