LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Report Generation Word without installing any word processing software

Solved!
Go to solution

Hi everyone,

               Is there a way to generate a word report in LabVIEW without installing any of the word processing software but only by installing the required libraries (For example : I must not be able to open MS Word on my computer but I must be able to use the report generation toolkit in Labview with a ".dot" file as the template for my report). I am doing this to ensure that the user (to whom a seperate PC is provided as a processor) does not misuse the MS Word license that is provided to him. 

               So, in short the Word Processing Software must not be available for the user to edit (general purposes), but it must be available when LabVIEW libraries want it for report generation.

               

               Thank you in advance

 

0 Kudos
Message 1 of 14
(7,128 Views)

Hi sr,

 

the RGT (Report Generation Toolkit) relies on MS Office as it basically communicates with Word using ActiveX. So the answer is: you need MSOffice installed to use the RGT.

 

A different answer/solution to your problem is: Use a different toolkit like XLR8! They allow creation of office files without need to communication with Office…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 14
(7,093 Views)

Thanks for your reply Gerd

 

XLR8 seems to be a toolkit to edit excel files.

But, my concern is about editing word documents(.doc/.dot) in Labview without the presence of any WPS.

0 Kudos
Message 3 of 14
(7,086 Views)
Solution
Accepted by topic author sr_nilabview

If you are using, or can switch to, docx files, they can be renamed to .zip extension.  And inside the zip file is a document.xml that can be edited.  If you are working with templates, I'm sure it would be easy enough to figure out how it all works, where your data should be populated, etc.  Working with templates, the formatting is already complete, in most cases, so it's just a matter of inserting data, headers, etc. and then saving the XML back into the zip and renaming the zip to docx extension.  This wouldn't require Office to be installed. 

 

I don't think this works with .doc files because, if I remember correctly, doc files are binary. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 14
(7,068 Views)
Solution
Accepted by topic author sr_nilabview

Cool, I did not know this "trick" (docx --> rename to zip --> unzip --> edit xml(s) --> zip again --> rename to docx)!  🙂

0 Kudos
Message 5 of 14
(7,054 Views)
Solution
Accepted by topic author sr_nilabview

In the past I've also generated PDFs using this toolkit which is super handy and doesn't require anything PDF related and no PDF printers, to create PDFs.  I know you specifically asked about text documents but I wasn't sure if you were just looking for general report generation functionality or needed a Word compatible format.

0 Kudos
Message 6 of 14
(7,032 Views)

Thank you for your replies.

"aputman" your solution works well.

Have to try out Exaprom PDF 2.0 as suggested by "Hooovvah". That too looks like a good alternative.

0 Kudos
Message 7 of 14
(7,016 Views)

But still there remains some garbage text in the converted document. I have attached the original .docx and the converted .docx.

I have just edited the word -> document.xml as suggested by you (aputman).

I have edited the <w:t> tag of the xml file alone. I haven't touched anything else. 

I too am trying to figure out what the problem is.

Download All
0 Kudos
Message 8 of 14
(6,994 Views)

You didn't zip the file.  You rar'd it.  And you have added an additional folder to the structure.  Inside the rar, you had the files inside a test folder.  the test folder should not be there.  

 

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 9 of 14
(6,929 Views)

And if you use the OpenG ZIP Tools Library you can even omit the .docx to .zip and back renaming. That library doesn't really care about the file ending in itself but simply opens the specified file path and tries to parse it as a ZIP file.

The file ending shenigan that Windows uses is a bit of an old DOS artefact, handy sometimes but often more limiting than anything else.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 14
(6,911 Views)