LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using WORD template to generate PDF report - Doesn't work on customer's PC

Hi,

I've set up a Word template using bookmarks to populate the test data.  The created file is then saved to a specific folder and file based on UUT parameters. The report generation works perfectly on the development system, both in the development mode and when running the entire test system as an exe. The system is set to open the document with the fields populated, automatically save to PDF and then close (for now, for troubleshooting I have it as "OpenAfterExport".

Fast forward to installing it on the customer computer. The testing is all processed correctly, but when Word is called and the template opens, there is no data being populated and the PDF is not saved.

 

I think it's a permissions issue with Word on the client's computer. Has anyone run into anything like this?

Attached is a snippit of a portion of bookmark data population and the word nodes being used.

 

 

0 Kudos
Message 1 of 8
(3,427 Views)

I have not run into this issue before... I have however had great luck performing the exact same task using PDFs directly.  It is reliable and doesn't require MS Word to be installed on the customer's PC. You take a PDF, add acrofields that can be populated with values and save it.  The report generation then just opens the PDF, fills in the blanks, flattens it (makes the blanks not editable) and saves it as a new file.

 

If you are interested, I'd start with Exaprom PDF report generator.

https://decibel.ni.com/content/docs/DOC-10952

 

In addition, I have attached the 2 main VIs I use to accomplish this task. The first one, "Read AcroFields.vi" returns a list of all of the current tags or blanks in the PDF that can be populated.  The second VI, "Stamp PDF.vi" takes all of the tags and corresponding strings and creates / flattens the new PDF. 

 

Download All
0 Kudos
Message 2 of 8
(3,408 Views)

Sometimes, when opening Word documents, you'll get a message about Enable Editing.  It's called Protected View.  I'm not sure what prompts that message to appear.  Maybe it's that the computer it was created on doesn't match the one it's being opened.  If that is the case, maybe this message is blocking your EXE from making changings and printing a PDF.  In Word -> Options -> Trust Center, there are settings for ActiveX or you can trust specific documents.  Hope this helps.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 8
(3,398 Views)

Well, after much angst, it turns out that the customer's version of Word was one step behind my build; same major version. It was the third stamp down, that's how minor the change was.  My version is Word 2010, we decided to try 2013 on their machine.  The reports worked perfectly.

 

Thanks for all of the suggestions.

 

M3rl3n

0 Kudos
Message 4 of 8
(3,352 Views)
There is a table here (not yet updated for LV2016) which details the compatibility between versions of the RGT and Office: http://digital.ni.com/public.nsf/allkb/C9408B9F08D711E786256F3300701D01

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 8
(3,347 Views)

BowenM,

 

I have a problem with "ReadAcrofields.vi"Read Acrofields.jpg

 

It is the property node key or the invoke node "to string()"?

0 Kudos
Message 6 of 8
(3,329 Views)

It is the Property node Key there...  it just returns the string name of the AcroField.

0 Kudos
Message 7 of 8
(3,310 Views)

I asked the question because I have no property available in "Object"Acrofields.jpg

I will try to solve that next week...

0 Kudos
Message 8 of 8
(3,300 Views)