LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Generation Tool Kit doesn't work when built into executable.

Solved!
Go to solution

Hello,

 

I am using the Report Generation Tool Kit to generate a Word document in a sub vi. The vi will initially prompt the user for some information and then it populates the report, ask the user to save, then closes MS Word. The code works perfectly in development, but when I build it into an executable, it does not launch MS Word, nor will it populate the data. I also do not see any error messages unlike other people who have encounter this issue.

 

From my research, I gathered that "NI_Word.lvclass" needs to be included in the project for it to work. However, the instructions on how to do that does not match what I see in the menus. Specifically, "NI_Word.lvclass" is not listed under the "Source files" tab in build dialog (see attached screenshot). Any help will be appreciated. Thanks.

 

Software versions:

LabVIEW 2017

Word 2013

 

Relevant links:

https://forums.ni.com/t5/LabVIEW/Labview-Report-Generation-NI-Report-LV-for-excel-does-not-work/td-p...

http://zone.ni.com/reference/en-XX/help/372120A-01/lvrgthelp/rgt_stand_alone_apps/

Download All
0 Kudos
Message 1 of 24
(5,219 Views)
Solution
Accepted by topic author OhmsLawyer

You don't use any of the Word specific VIs so the word class is excluded from the build.  I would just add a Word Get ActiveX References VI at the beginning of your generation code and then rebuild your EXE.  This should be enough to get the right dependencies included. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 24
(5,201 Views)

@aputman wrote:

You don't use any of the Word specific VIs so the word class is excluded from the build.  I would just add a Word Get ActiveX References VI at the beginning of your generation code and then rebuild your EXE.  This should be enough to get the right dependencies included. 


I guess I would do this, too.

 

-----------

How to get this to work:

http://zone.ni.com/reference/en-XX/help/372120A-01/lvrgthelp/rgt_stand_alone_apps/

From the Source Files page of the Application Properties or Shared Library Properties dialog box, navigate to and select the class files you added to the project. Click the right arrow button next to the Always Included list to add the class files to the application.

 

I manually copied the file

"C:\Program Files (x86)\National Instruments\LabVIEW 2017\vi.lib\Utility\NIReport.llb\Word\NI_Word.lvclass"

 

..to the directory where my .lvproj is. Then drag and dropped this to the .lvproj - which will indicate a warning.

 

Then "NI_word.lvclass" shows up in the Source Files menu, and you can add it via Always Included.

lvclass.PNG

 

Message 3 of 24
(5,192 Views)

Thank you aputman, it works now.

0 Kudos
Message 4 of 24
(5,181 Views)

alexderjuengere :

 

I tried your method, but I cannot drag and drop "NI_Word.lvclass" into the ".lvproj" file. Maybe I am misinterpreting your instructions?

 

 

0 Kudos
Message 5 of 24
(5,178 Views)

@OhmsLawyer wrote:

alexderjuengere :

 

I tried your method, but I cannot drag and drop "NI_Word.lvclass" into the ".lvproj" file. Maybe I am misinterpreting your instructions?

 

 


did you try to add the original file or did you try to add a copy of that file ?

 

strange, but nevermind, you solved your problem already 😉

 

 

 

 

Message 6 of 24
(5,172 Views)

did you try to add the original file or did you try to add a copy of that file ?


I made a copy of the file into same folder as the .lvproj file. Then, I dragged and dropped it into the .lvproj file. But, it did not give me errors and does not seem to do anything at all. I also checked the source files tab to see if it is listed. It is not.

Thank you for your help anyway. It would have been nice to be able to manually add it without making changes to the VI.

0 Kudos
Message 7 of 24
(5,169 Views)

Manually adding it like that doesn't work because it doesn't prevent the compiler from removing methods associated with the Word class from VI's such as Append Table to Report.  If you double click to open one of these, you can select to open the Word implementation or the standard implementation.  You have to force the issue by keeping the references in the code, otherwise the compiler will remove them completely.  

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

I have tried this method and am still unsuccessful. I am trying to create a basic word report (no template) and always fail the "create report" step due to the executable not being able to locate the NI_Word.lvclass file. I have added that file to the source files and included in the "always included" section of the build but it doesn't seem to have any impact on the error. Has anyone else run into this?

 

I am using labview 2018 and am testing the application on the same computer as development now (to remove any conflicts of MS word versions).

 

 

0 Kudos
Message 9 of 24
(4,440 Views)

You should not need to Always Include the word class.  However, the Create Report is not enough to force the dependencies to be included in the build.  You need to use a Word Specific VI to have it pull the proper dependencies.  At a minimum, if you drop the VI "Get ActiveX References", this should be enough to make the build work properly.  

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 10 of 24
(4,428 Views)