Solution
This happens when the Report Generation Toolkit's dynamic VIs are not included during the build process. Follow the steps below based on your LabVIEW version to include the dynamic VIs during the build process:
LabVIEW 2024 Q1
When building applications with Report Generation VIs, you must complete the following additional steps:
- Add the proper .lvclass files to your project
- If your application uses Microsoft Word, right-click My Computer in your LabVIEW project, select Add>>File..., and select the following file: C:\Program Files\NI\LVAddons\rgt\1\vi.lib\Utility\NIReport.llb\Word\NI_Word.lvclass
- If your application uses Microsoft Excel, right-click My Computer in your project, select Add>>File..., and select the following file: C:\Program Files\NI\LVAddons\rgt\1\vi.lib\Utility\NIReport.llb\Excel\NI_Excel.lvclass
- In the My Application Properties dialog box of the Build Specifications select the Source Files tab located on the left.
- Then navigate to and select the .lvclass files you added to the project. After selecting the files, click the right arrow button located next to the Always Included box to add the class files to the Always Included list. This will add the class to the application.
Note: If the application you are building contains the MS Office Report Express VI, you must add any Microsoft Word or Microsoft Excel templates that you use to the LabVIEW project and to the application. You can do this by adding the templates to the Always Included list under the Source Files tab of the My Application Properties dialog box.
LabVIEW 2014 until LabVIEW 2023 Q3
For LabVIEW 2014 until LabVIEW 2023 Q3, the steps will be similar as LabVIEW 2024 Q1 but only the file path for the .lvclass files was changed.
- If your application uses Microsoft Word, right-click My Computer in your LabVIEW project, select Add>File..., and select the following file: [LabVIEW20xx]\vi.lib\Utility\NIReport.llb\Word\NI_Word.lvclass.
- If your application uses Microsoft Excel, right-click My Computer in your project, select Add>File..., and select the following file: [LabVIEW20xx]\vi.lib\Utility\NIReport.llb\Excel\NI_Excel.lvclass.
- In the same way as for LabVIEW 2024 Q1, in the My Application Properties dialog box of the Build Specifications select the Source Files tab located on the left.
- Then navigate to and select the .lvclass files you added to the project. After selecting the files, click the right arrow button located next to the Always Included box to add the class files to the Always Included list. This will add the class to the application.
- Please refer to the image on the LabVIEW 2024 Q1 section of this article to see how it should look once the proper steps have been followed.
LabVIEW 8.6 to 2013
Versions of the toolkit with LabVIEW 8.6 and later use LabVIEW classes, which dynamically call VIs depending on what report type is being generated. In order to build an executable that uses dynamically called VIs, you must include these VIs in your build specifications.
- In your Project Explorer window, right-click on My Computer and select Add»Folder (Snapshot).
- Navigate to C:\Program Files\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb or C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb (where x.x refers to the specific version of LabVIEW being used) and click Current Folder.
- Repeat the same procedure to add the LVClass folder by navigating to C:\Program Files\National Instruments\LabVIEW x.x\vi.lib\Utility\LVClass or C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\LVClass
- After you have the two folders in your LabVIEW Project, you can add them to the Always Included section of the Source Files category of the Build Specifications as in the picture below.
LabVIEW 8.0, 8.2, and 8.5
- Application Builder only lets you add files from your project therefore you have to add this file to your Project Explorer first:
- Then you can add it as a dynamic VI inside the Application Builder:
Note: If you are using the MS Office Report Express VI, you should include the template used by the Express VI in addition to your application. The configuration of the MS Office Report Express VI relies on a report template which is either a basic template provided in the LabVIEW templates directory or a custom template provided by the user. When an executable is created with the MS Office Report Express VI, the template must also be included as a support file in the Source Files tab. This will add the template to the "data" directory so that the executable will be able to call it upon execution of the program.
LabVIEW 7.x
- Add the Word and Excel dynamic VIs in LabVIEW 7.x, click on the Source Tab in Application Builder and select Add Dynamic VI.
- If using Microsoft Excel, please include the path LabVIEW7.x\vi.lib\addons\_office\_exclsub.llb. A file dialog box should come up. Select _Excel Dynamic VIs.vi then click OK.
- If using Microsoft Word, please include the path LabVIEW7.x\vi.lib\addons\_office\_wordsub.llb. A file dialog box should come up. Select _Word Dynamic VIs.vi then click OK.
LabVIEW 6.x
When you build a stand-alone application or DLL that uses the LabVIEW Report Generation Toolkit 1.0, the support file directory containing _wordsub.llb and _exclsub.llb must be located in the same directory as the application or DLL and it must be in a subdirectory named Data (the default support file directory for the Application Builder). If Error 7 is still thrown when executing the application, _wordsub.llb and _exclsub.llb need to be mass compiled to re-link their VIs. Mass compiling is done by selecting Tools»Advanced»Mass Compile.
Other general steps
If the steps above do not resolve the issue, you can also check the following:
- The path being written to matches the exact path on the computer; including spaces.
- Both the Windows User and the Application (.exe) have read/write access and Administrator privileges.
- To set this privilege on your Application, you can right-click on your .exe file and select Run as Administrator.
- Confirm there are no conflicts in the project, as explained in the document Resolve Project Conflicts Dialog Box.
Note: Sometimes after following these steps, a broken VI error will occur in the Report Generation Toolkit due to differences between versions of Microsoft Office. To resolve this, follow the article LabVIEW Report Generation Toolkit VIs Broke.