LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

word report with template

Hello, Smiley Happy
 
i want to create a word report with template in my vi. I have made a word .dot with bookmarks and my customer should modify it. It look like this:
 
 
Test number: [bookmark/Test number]
User: [bookmark/User]
 
Serial number: [bookmark/Serial number]
Error: [bookmark/Error]
Comment: [bookmark/Comment]
 
Date: [bookmark/Date]
 
Greetings XY
 
 
How can I get this result? Smiley Indifferent
 
 
Test number: 12345
User: XY
 
Serial number: 1
Error: No
Comment: First
 
Serial number: 2
Error: Yes
Comment: Second
 
Serial number: 5
Error: No
Comment: Third
 
Serial number: 9
Error: Yes
Comment: Fourth
 
Date: 01.01.2006
 
Greetings XY
 
 
The data is in tables and strings. The beginning and end of the word report is quiet easy. The difficulty is the middle part it can be consist of different numbers of items.
 
How can I made this? Smiley Surprised
 
thankyou
 
schwede Smiley Wink
0 Kudos
Message 1 of 7
(3,746 Views)

I didn't realize you posted this question twice.  Here is a link to my response on the other thread, along with the text from that post:

http://forums.ni.com/ni/board/message?board.id=170&message.id=176804

This should be pretty easy to do with the LabVIEW Report Generation Toolkit for MS Office:

http://www.ni.com/toolkits/report_gen.htm

In fact, the toolkit includes the MS Office Express VI, where you can specify a template document, and you can wire in whatever values you want inserted at certain bookmarks in the document.

Let me know if you have any other questions,
-D

0 Kudos
Message 2 of 7
(3,742 Views)

Hello,

my problem isn`t to create a word report, that is (you are right) pretty easy. The problem is to generate the middle part. In the template the middle part exists only one time, but if the data have more than one entry. The middle part mus be inserted for each data entry. Compare the template and the word report.

hope you can help

schwede Smiley Sad

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

You could call the Append Text to Report.vi in a loop, where the first iteration of the loop inserts the text at the specified bookmark, and every subsequent iteration inserts the text below the previous text (this is the default way that text is appended when not specifying a bookmark).

-D

0 Kudos
Message 4 of 7
(3,722 Views)

That is ok, but if I do so the result would look like this:

Test number: 12345
User: XY
 
Serial number: 1
2
5
9
Error: No
Yes
No
Yes
Comment: First
Second
Third
Fourth
 
 
Date: 01.01.2006
 
Greetings XY

Do You know what I mean?

 

 

Message Edited by Schwede on 04-03-2006 12:22 AM

0 Kudos
Message 5 of 7
(3,713 Views)
Hi Schwede
If I understand your problem correctly, that the amount of data (text) can vary dependant on the test results
then surely the solution would be to determine the worst case option first and generate a template based on that.
Thus if a DUT passes all tests sucessfully then you have minimum text reporting. So you initial data(text) treatment would result in blank
spaces in your report. So your book marks would just handle a blank space. Thus you report would be a predefined size which would be able to
handle good and bad DUT's.

Hope you can understand the idea.


Regards
Xseadog
0 Kudos
Message 6 of 7
(3,705 Views)

I was thinking that instead of having a bookmark for the three items separately in the Word document, you could just have a single bookmark indicating where you want *all* the results inserted into the report.  Then, generate the text like "Serial Number" with the report VIs themselves instead of having it already present in the Word document.  That way, my looping suggestion would work.

-D

Message 7 of 7
(3,692 Views)