06-19-2018 04:05 PM
Hey All
I am trying to create a flexible MS Word Word Report Template for my program. I am using a Template file and bookmarks because it allows me to set individual widths for the columns of my data and more control over the appearance in general. However, the number of rows of data I will have will vary depending on the test case, it could be anywhere from 1 to 100 rows. Is there any way to programmatically control this? I found that if my template file table/bookmark defaults to say 10 rows, and I have 12 rows of data from an array, that rows 10, 11 are clobbered. I don't want to set my default template to 100+ rows and have a bunch of blank rows for the smaller test cases. I have tried both using the MS Word express VI, and manually configuring a new Test Report, but can't figure it out.
I did find this thread:
https://forums.ni.com/t5/LabVIEW/Adding-lines-to-a-Table-Word-Template/td-p/1051395
But it is from 2010, and I can't find a record of the issue still being active.
This is LabVIEW 2017 Full.
Thanks!
Solved! Go to Solution.
06-20-2018 12:26 AM
Hi David,
there might be a better solution than this, but here's how I usually solve this:
I create a bookmark on a blank page, same way you would when inserting a block of text. During the test, I save all the data that needs to go into the table in an array (of cluster or directly the 2D array you're gonna need later). When the test finishes I fill a table with the data and insert it at the bookmark using the "Append Table to Report" VI.
06-20-2018 03:25 PM
There is a VI in the RGT called "Word Insert Row-Column-Cell". Just call this function in a for loop as many times as needed and then add your data into the table using the "Word Edit Cell" function set to array data type. Be sure to set the table index property for both functions.
07-13-2018 01:38 PM
Hi David,
Did you find a solution to this? I am struggling with this problem as well.
bbell
08-01-2018 10:13 AM
Yes aputman's solution above works very well. Sorry about the late reply and thanks to those above for the help