LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing a VI in a Sub Panel

I came across another incompatability between LV 7.1 and 8.0.  I have a program that loads one of several VIs into a subpanel.  The sub VI has a print button which grabs an image of its front panel, adds it to a report, and prints the report.  This worked fine in 7.1.  However, in 8.0, the image on the printout is shifted to the right and only half visible.  I figured out that this is due to the positioning of my subpanel, which is at about (200,40).  In 7.1, when I got an image of the front panel of the sub VI, it would start at the upper left corner of the subpanel.  In 8.0, it starts at the upper left corner of the main VI, which causes blank space to the left of the subpanel image on the report and the right side gets cut off.
 
Has anyone else come across this?  Did I even explain it well enough to understand?

Message Edited by Marc A on 02-13-2006 10:05 AM

0 Kudos
Message 1 of 15
(3,152 Views)
I'll bump this once to the top, maybe a new day will yield some ideas.  If not, I'll keep looking and trying different things to get this to work correctly.
0 Kudos
Message 2 of 15
(3,123 Views)

Hi Marc

Can you post a simple example that reproduces this issue?

Thanks,
Chris J

0 Kudos
Message 3 of 15
(3,108 Views)

I threw this together real quick, it shows exactly the problem I'm having.  The graph in the subpanel is all the way at the upper left corner of the panel, but when you click the print button, the method returns an image that is from the upper left corner of the main VI but doesn't include anything from the main VI's front panel.  There is just empty space. If you enable the scrollbars on the subvi and scroll a little to the right so that the graph moves left while it's running, and then print, you'll see that the graph on the prinout also moves left, so it isn't a margin problem or anything.

Also, I made this do exactly what my program does, but you can take out the print report if you dont want to keep printing, you could just make the image data an indicator, or probe it to see the picture.

Message Edited by Marc A on 02-14-2006 04:56 PM

0 Kudos
Message 4 of 15
(3,105 Views)

Hmm,

When printing with your VI the graph was shifted. However, when I built my own VIs (basically just duplicates of yours) in 7.1 and then upgraded to 8 they both print in the same location. I did have to relink the New Report function, but that was the only real problem. Do you see similar behavior?

 

Message Edited by ChrisJ on 02-15-2006 05:06 PM

Download All
0 Kudos
Message 5 of 15
(3,073 Views)
I am having this same problem. Has anyone come up with a solution yet. I tried both of the included examples on my machine and the image is offset to the right as described in the original problem.
 
I have an application that dynamically loads VIs into a subpanel. I would like to use the FP.GetImage method to get an image of the currently loaded VI and add it to a report. When I do this, the image is shifted to the right. I have tried a multitude of different ways of getting the image to no avail.
 
This has been driving me nuts for a couple days now. I would appreciate some help.
0 Kudos
Message 6 of 15
(2,927 Views)

The way I finally worked around it was to redesign my VI so that the subpanel is all the way to the left and my control panel is on the right. It was the other way around before. By moving the subpanel as close as possible to 0,0 of your main VI, the image you save will not have that extra space in it.

It's only a workaround, but it works.

0 Kudos
Message 7 of 15
(2,905 Views)

Marc,

     Unfortunately this would not work for me.

     I passed this on to NI support and they had no problem duplicating the issue. They are sending it on to R&D to see if they can resolve it. I'll let you know what happens.

0 Kudos
Message 8 of 15
(2,902 Views)
Right, I can see it not being possible for you to rearrange your whole program just for this problem. This seems like a simple fix that should have been addressed in 8.2, but yet it still doesn't work the same way it did in 7.1. I'm sure they're working on it though.
0 Kudos
Message 9 of 15
(2,898 Views)
Marc,
     Let's hope so.
 
     I have noticed a number of little things in 8.x like combo box controls not displaying properly, drop down controls behaving erratic when only a few items are in the list, etc. What really got me was how they changed scroll bars for sub panels in 8.x. If you enable the scroll bars on the VI inserted in the sub panel, it allows the user to scroll beyond the visible area of the front panel. It took me a while to come up with an alternative that gave me the same functionality as 7.1.
0 Kudos
Message 10 of 15
(2,897 Views)