LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Report to File (Report Generation Toolkit) isn't actually saving anything

I believe the same issue I'm having was touched upon in the comments here but I still don't have any resolution to the issue with the "file close" methods they discussed.

 

It's been an ongoing issue when using this Save Report to File VI. I'll open a template, output all my information to an Excel report, then attempt to use this Save Report to File VI at the end. I watch all my data get dumped appropriately to the report, but the process ends in an Excel file that is open with my report, is still "named" as the original template file it was built off of, and the user must then manually select File >> Save/Save As to actually save it. 

 

In the code attached, I have also tried adding a Dispose Report VI after the save, with the only difference being that the Excel application/report opened closes out but doesn't save anywhere. I am using Windows 7 but this issue exists on Windows 10 machines as well. LabVIEW Professional 15.0f2 (32-bit). Excel version is 2016. 

 

snippet.png

0 Kudos
Message 1 of 15
(6,163 Views)

Could you perhaps post your template file? I tried running your code with a blank "template" Excel file and it worked fine for me (LV 2018).

 

Then again, some of the Report VI's are different in 2018, and the issue in the post  you linked has been fixed in my version.

Edit: I tested it in LV2016 and it works fine there too.

0 Kudos
Message 2 of 15
(6,155 Views)

Bert, here you go. Thanks! 

 

Has anyone tried this in LV 2015? 

0 Kudos
Message 3 of 15
(6,147 Views)

Not sure what to tell you here; when I use your template (which is just a blank workbook, right?) with your code it works as expected- a file named Test_Output shows up in the same folder as Test_Template with the word "Test" in it.

 

It could be a bug in the 2015 Report toolkit, as I'm using Excel 2016 as well.

0 Kudos
Message 4 of 15
(6,131 Views)

That's frustrating. I'll give NI support a call about it. 

 

I honestly wouldn't need it if I could somehow do more in-the-weeds ActiveX invokes on the report that's opened by this process. As a simpler explanation, I need to take the code I've posted and start duplicating the worksheets and moving the duplicates to the last (rightmost) tab position. That code is already out there, but I'm not confident I could merge that functionality in. 

0 Kudos
Message 5 of 15
(6,116 Views)

Are you running this on a fresh install of Office?  If so, open up Excel and make sure there are no dialogs that pop up. 

aputman
0 Kudos
Message 6 of 15
(6,114 Views)

@dest2ko wrote:

That's frustrating. I'll give NI support a call about it. 

 

I honestly wouldn't need it if I could somehow do more in-the-weeds ActiveX invokes on the report that's opened by this process. As a simpler explanation, I need to take the code I've posted and start duplicating the worksheets and moving the duplicates to the last (rightmost) tab position. That code is already out there, but I'm not confident I could merge that functionality in. 


Ah! Well you're in luck. It's not the MOST straightforward thing you can do, but here's how to get the ActiveX references, onto which you can use Invoke and Property nodes to "do stuff":

 

activex.png

 

Report generation -> Excel specific -> Excel advanced -> Excel Get ActiveX References.vi

0 Kudos
Message 7 of 15
(6,109 Views)

aputman, no dialogs appear. It goes straight into a blank workbook. 

 

One peculiar thing I notice, is that when I close out said workbook at the top right (X), rather than closing the application out, it closes out the workbook and just leaves a "shell" of an application open. It hasn't always done this in the past. Not sure if that's a factor here. Screenshot attached.

 

 

snippet2.png

0 Kudos
Message 8 of 15
(6,101 Views)

I've seen this issue come up before (or something similar to it).  When you try to open the Save Report to File VI and it asks you to Choose Implementation, what do you see?  Is there an option for an Excel report?

aputman
0 Kudos
Message 9 of 15
(6,086 Views)

Try this and see what happens:

Restart LabVIEW

Open a new VI and drop down the "Save Report to Disk.vi"

Double click the VI and see what options are available for Choose Implementation.  You should not see anything about Word or Excel.

 

Now repeat the process by restarting LabVIEW.  But first place down a VI from the Excel Specific palette.  This will load the Excel class into memory.

Now when you drop the "Save Report to Disk.vi" onto the block diagram, you should see an option for Excel in the Choose Implementation.

 

aputman
0 Kudos
Message 10 of 15
(6,075 Views)