11-29-2018 11:53 AM
Hello,
I use the Report generation toolkit to created a xls report and insert a graph. You can find attached an extract of my code (VI "Test").
Randomly, the graph is not properly displayed, it is empty. I just see the border filled with white. The graph appears if I move it or if I double click on it.
Do you have an idea why the graph is not always visible?
It seems that it's a known issue according comment "Attempting to avoid occasional problem where graph appears blank" in VI "Excel_Quit_Graph":
I use LabVIEW 2017 SP1 32 bit, Office 2013, Windows 7.
11-29-2018 04:11 PM - edited 11-29-2018 04:12 PM
Appears to be an Excel problem, not a LabVIEW problem. NI engineers were trying to find a way around the Excel bug but apparently it doesn't work.
11-30-2018 08:24 AM
Well, I can partly confirm that your code does not work in LabVIEW 2018 with Excel 2013. I also took the liberty of replacing the deprecated New Report function with the current replacement, Create Report, which made no difference.
I also ran the Revised "Generate Excel Report" example that I posted on this Forum in 2014 (search for Revised <Quotation mark>Generate, and it should pop up). I ran it with the deprecated New Report and the current Create Report and got a nice Report with Graph. One should be able to start from "what works" and gradually modify it, one step at a time, to "what fails" (or vice versa) and get more insight into the failure ...
Bob Schor
12-05-2018 10:21 AM - edited 12-05-2018 10:22 AM
Hello,
Your VI works because you don't call "NI_Excel.lvclass:Excel Quit Graph" VI.
I don't know if it's mandatory to call it after creating a graph...?
Edit: it is much better to call it because it closes all graph ActiveX references.
12-06-2018 05:13 AM
@Romain.P wrote:
Hello,
Your VI works because you don't call "NI_Excel.lvclass:Excel Quit Graph" VI.
I don't know if it's mandatory to call it after creating a graph...?
Edit: it is much better to call it because it closes all graph ActiveX references.
Let me see if I understand what you are saying -- I make graphs in Excel using the tools that LabVIEW provides with the RGT, and it works. You say "it works because I don't call (some function that may or may not be necessary, but doesn't seem to be prominently featured in the RGT". You've demonstrated that if you do it your way, it fails, while if I do it "my" (and "LabVIEW's") way, it works. I guess I'll do it my way, as it makes more sense to do something that works, rather than call an extraneous function that makes it fail.
Bob Schor
12-06-2018 09:18 AM - edited 12-06-2018 09:19 AM
@Bob_Schor wrote:
You've demonstrated that if you do it your way, it fails, while if I do it "my" (and "LabVIEW's") way, it works.
What do you mean by LabVIEW's way? This is a LabVIEW VI from the Report Generation Toolkit.
12-06-2018 09:44 AM
12-06-2018 10:24 AM - edited 12-06-2018 10:31 AM
@aputman:
Son of a gun, you are absolutely right! I never noticed that function, and (clearly) have never used it. I know I've (recently, meaning using LabVIEW 2016) written code that created Excel Reports with multiple graphs, and never called this function -- the code worked just fine, so maybe (a) I was just "lucky" that omitting a "necessary" function didn't break my code, (b) the function really isn't "necessary", and in some cases it will "break code", or (c) the function is OK, but it might not be being used in the proper manner.
I just looked at my code. I've got data from an experiment monitoring multiple Stations, and want to write an Excel Report consisting of multiple Sheets, one per Station. The report has some tabular data plus two graphs, one a scatter plot and one a line graph, per sheet. I do not use Excel Quit Graph anywhere in this code (as evidence of my ignorance that such a function was part of the RGT). The basic logic is I open a (blank) WorkBook, fill in as many WorkSheets as I have Stations, each WorkSheet getting two Graphs, then Save Report to File and Dispose Report (which closes Excel). None of my Graphs are blank.
What can I say? This works, and apparently using Excel Quit Graph might not. I think I'll continue not using it until a need arises ...
Bob Schor
P.S. -- just saw Ben's Reply, saying "stretching the Graph slightly might cause the Graph to reappear". Still sounds like a bug. BS would say "Not using Excel Quit Graph will cause the Graph to not disappear" (I hope I said that correctly -- there are too many negatives ...).