LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Generation Toolkit using wrong lvclass VIs

Solved!
Go to solution

Hello

 

I have a problem with RGT using wrong VIs.

Program is set to open a dotx template and save a word document, however this actions fails as document can not be opened. This is the full error:

Possible reason(s):

LabVIEW: (Hex 0x7) File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.


Complete call chain:
     Get LV Class Default Value.vi
     NI_report.lvclass:New Report.vi
     ReportSaveAndPrint.vi
     AnalyzeIt.vi
     Main.vi

LabVIEW attempted to load the class at this path:
C:\Program Files (x86)\Main\Carbon2015.exe\1abvi3w\vi.lib\Utility\NIReport.llb\Word\NI_Word.lvclass

 

From what i gather NI_Word.lvclass is not included in the application during building. I checked this and it's true, instead Labview includes NI_HTML.lvclass. 

I found some solutions online advising that you manually add a proper lvclass file to the project, but for some reason it won't let me. I also tried replacing all VIs that use NI_HTML.lvclass for ones that use NI_Word.lvclass, but when application is built it just replaces VIs for the HTML class ones.

 

This is the VI that does the report:

 

image.png

 

So my question is, how do i force Labview to use NI_Word.lvclass instead of HTML one? No function from NI_HTML.lvclass is needed, because report only generates a Word (docx) file.

I am using Labview 2018 (x86) to build an application.

 

0 Kudos
Message 1 of 7
(3,317 Views)

I'm sorry, but what you show isn't "the VI that does the report".  It's a small print, hard-to-read, impossible to test, picture of some LabVIEW code.

 

I just wrote a very tiny test routine that opened a Word report, wrote two lines of text, saved it to a thumb drive as a docx, and disposed of the Report.  Worked fine.

 

If you don't want to attach your VI so we can really see what you are doing, I recommend that you try writing a simple test routine (as I did), test it, then start adding other bits and pieces until it duplicates the functionality that is now not working for you.  Does the failure only happen when you try to build an Executable?  Do you get the same error when running in Development mode?  [I confess I didn't try my little routine in an Executable ...].

 

Bob Schor

Message 2 of 7
(3,283 Views)

I'm sorry, i thought the image would be enough...

 

I did what you said and if i run a VI it completes normally, no errors or anything.

However when i build it to an executable i get this error:

image.png

 

I also added a VI(s) in question and document template.

As said, when i run VI it completes OK, but when i run an executable i get the above error. Changing functions from NI_HTML class to NI_WORD class didn't help, they just get switched back during building.

 

Edit: The error in my original post was taken from executable application ran on machine from production, the second one was made on my computer, thus a bit of a difference.

Download All
0 Kudos
Message 3 of 7
(3,258 Views)
Solution
Accepted by topic author AeroSoul

The problem with the executable is that the classes for Excel and Word are loaded dynamically.  This means you have to explicitly add them to the project and "Always Include" them in the executable.  How did you try adding the classes to your project?  I know I have done this (back in LabVIEW 2012, but it should still work).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(3,230 Views)

Found a similar thread from 2010 and turns out i was trying to add these files in a wrong way (due to weird description on support page)

Managed to add them now and it works.

 

Thank you all for help.

0 Kudos
Message 5 of 7
(3,205 Views)

Could you please comment a link to that 2010 forum, I'm running into a very similar issue. Thank you!

0 Kudos
Message 6 of 7
(1,797 Views)

In 2012, I posted a Revised "Generate Excel Report" Example in the Forums.  I just downloaded that (old) code, put it in a Project, and built an Executable without doing anything "special", just copying the Top Level VI ("Excel Demo") to the right side for the Build.

 

Of course, it worked, but threw an Error!  Stupid me, I specified an "Invalid Path" for the output file (step 13).  When I replaced the "Strip Path" function and its input ("Application Directory") with "Get System Directory" with input "User Desktop", it worked perfectly, and showed the expected Demo Spreadsheet.

 

I'm running Windows 10 (64-bit), LabVIEW 2019 (32-bit), and the current version of Office.  This should, I hope, also work for you.

 

Bob Schor

0 Kudos
Message 7 of 7
(1,783 Views)