03-15-2013 04:18 PM
I am using Simplicity PDF generator to add a XY Graph to a PDF report, same handle is used in Excel report and works fine. The XY Graph shows up fine when the code it run in development mode, when run as executable, the graph insert routines fail for lack of finding the temp *.bmp fle for the graph 1172. See attachments. Anyone have any idea why the loss of the handle/temp graph error?
Solved! Go to Solution.
03-16-2013 12:28 PM
As you said, the error simply says that it can't find the file, which most likely means that the file wasn't created.
My guess would be this - you're creating the graph in the subVIs with the + and control icons (which is presumably PDF_Generator.Writer.AddImage.vi) and the VI which is shown in the image never has its FP displayed.
By default, LV removes the FP of all the VIs going into the EXE unless it decides it's going to need the FP. If the FP is removed then the image of the control cannot be accessed and that would presumably prevent the file from being created. The easiest way to confirm this is to create a static property node for one of the controls on the front panel. This will force LV to keep the FP when building the EXE.
If that doesn't help, then you need to see exactly where the BMP file is supposed to be generated and see if you can log an error from there.
03-17-2013 10:42 PM
Thanks for the suggestion tst. You may be on to to something. I'll give some things along that line a try and get back to let you know.
03-18-2013 11:18 AM
Tst your solution did work. Interestingly the Create Excel Front Page routine also uses the same technique and the graph comes up in that
report fine. It was just the PDF one that had the issue. Changing the form properties, so the front page displays briefly while the report
is being generated, resolved the issue with the graph plot handle to the temp file and it comes up in when run as an executable fine now.
08-13-2013 10:40 AM
Would like to thank tst for the solution on this, and add a few tweeks:
In VI Properties -> Window Appearance; choose "Custom" and click the "Customize" button. Use the following settings:
Check "Show front panel when called" and "Close afterwards if originally closed", uncheck "Show front panel when loaded".
Check "Window runs transparently" and set the value to 100%.
-> These settings ensure that the front panel is opened, but it is opened in "Invisible mode", thus eliminating the brief display of the window to the (presumably "dumb") user.
I additionally set more or less all the other settings to minimize user interruption of the process.
08-13-2013 10:51 AM
If you want this to be more clear, you can also do all of this in code - just call the VI's FP.Open method when it starts running (and set the state input to hidden) and call the FP.Close method when it's done. This should allow you to document exactly what you're doing and not to have someone change it by accident.