LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Generation Toolkit is overwriting Test Results

Solved!
Go to solution

I have a state machine that is used to run different tests. You can select any number of the test to run or run them all. I want to make it to where I can add the test results of all of the tests that were ran to one word document. I have a word template for all of the possible tests with a bookmark at the top where I usually call it "Insert_Page". When one test completes, it saves the document to a file, I then run another test until it completes and then use "Word Insert Object" from the tool kit to add the saved report to the current report.

 

This all seemed to be working fine, but I realized that I wanted to put a test end time on the cover page, so I reworked it so that it will get added last, because saving them converts them from a template (.dotx) to a doc. I changed the coversheet out with an equipment list as the first document and everything else is the same, but now instead of adding a page, it writes over the previous test with the new test. So now I end up with the equipment list and the last test ran.

 

Does anyone have any suggestions?

0 Kudos
Message 1 of 4
(388 Views)

I mostly use the RGT to work with Excel Workbooks.  I've also made a few HTML reports, but have never tried to handle a Word Document.

 

One method that comes to mind is to save the Test data in a suitable format (maybe even an Excel WorkBook), and put off writing the Word Report until all the tests have been run.  Then use the RGT to open an empty Report, fill in all the Header information you want, then read in the (temporary) file with all the Results, format them the way you want, and write the "Results" section of the Word Document.

 

Bob Schor

0 Kudos
Message 2 of 4
(325 Views)
Solution
Accepted by Bob_Schor

Hey, Bob. I was using bookmarks as a target for the Word Insert Object VI. I ended up just removing the bookmark and it automatically inserts the populated template at the end without overwriting anything. 

0 Kudos
Message 3 of 4
(313 Views)

Hi, T_Black.  Congratulations on finding the fix.  Please mark your post saying how you fixed it as the "Solution" to help the next person with the same problem.

 

Bob Schor

0 Kudos
Message 4 of 4
(299 Views)