LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PrintPanel is not printing one (of several) EditNumeric control on a panel

Aaron, thanks for your reply. As far as I can tell the call to the PrintPanel routine is the same as the one you gave me, except that the last parameter is 0, instead of 1. I tried switching that back and forth in the test code you gave me and it seemed simply to turn on and off the print dialog box as I expected. So, I guess my remaining question is "Is there a way in code to turn off the printing of a single control on a panel, such that the rest of the panel prints--just not that one control--when using the PrintPanel function?" Perhaps related to that question is "Are there any limits, e.g., number of controls on a form or controls in a project, that I might be running up against that m
ight cause this type of behavior?"
0 Kudos
Message 11 of 16
(722 Views)
Hello,

There is nothing that I can find that should let you disable printing for only one control. Nor is does there seem to be any limit on the number of controls you can print on a single panel. If I were you I would test out the following things:

1. Try a different printer.
2. Try a different computer.
3. Delete the control and create a new one.
4. Rename the control.
5. Move the location of the controls on the panel a bit.

In general, try making as many different changes as you can. If you still are getting the same error, you can post your code. If you do so, make sure that I will be able to merely open the project and run it without having to set up any
thing else at all. Include step by step instructions that I should follow the replicate the problem.

Aaron B.
National Instruments
0 Kudos
Message 12 of 16
(722 Views)
I have cut down the project to the point that I believe it should run without requiring anything else. This version replicates the problem on my PC. The step by step instructions are as follows:

1. Click on "Done" when the first screen appears (after the splash screen).

2. Click on "Setup" on the menu.
2.a. Click on "Secondary" on the submenu.
2.a.1. Click on the "Print" button on the form
2.a.1.a. Compare the print out with the displayed panel.
- note the missing "PRF Pump Intrv" control
- also note the missing "Print" button.
2.a.2. Click on the "Done" button on the panel.

3. Click on "Setup" on the menu.
3.a. Click on "Primary" on th
e submenu.
3.a.1. Select "Rich to Lean" on the "MON"/"Fuel Type" control
3.b. Click on the "Done" button on the panel

4. Click on "Setup" on the menu.
4.a. Click on "Secondary" on the submenu.
4.a.1. Click on the "Print" button on the form
4.a.1.a. Compare the print out with the previous printout.
- note the missing "PRF Pump Intrv" control now prints
4.a.2. Click on the "Done" button on the panel.


5. Click on "Setup" on the menu.
5.a. Click on "Admin" on the submenu.
5.a.1. Click on the "Print" button on the form
5.a.1.a. Compare the print out with the displayed panel.
- note two missing controls and missing print button
5.a.2. Click on the "Done" button on the panel.

6. Click on "Quit!" on the menu.
6.a. Click on "Yes" to exit the application.
0 Kudos
Message 13 of 16
(722 Views)
Hello Gary,

I have ran your code with the step you gave and also am seeing the errors that you have pointed out. I have spoken further with other engineers about this issue to make sure that I have not missed anything simple. Everyone agrees that there should not be any way to disable individual controls for printing. I have tried to debug this program for you a bit to determine what is causing the problem; however, this is not a trivial piece of code.

At this point, the best thing to do is to isolate a single problem (ie: the print control not printing). We know that in a simple program, everything works fine. Start taking out pieces of your code sy
stematically, keeping track of when the problem goes away. I may have to take this problem to our Product Service Engineers in the R&D department. But with over 6000 lines of code, it is almost impossible to see what is causing the problem. Please simplify the problem as much as possible. Anything at can be removed while still seeing the problem should be removed. Get rid of as many of the extra UIRs and other controls as possible. The program does not need to function correctly. Determine what small change is the difference between printing successfully and not.

Aaron B.
National Instruments
0 Kudos
Message 14 of 16
(722 Views)
Gary,

On line 3971, in your print button callback function, you set three of your controls to be invisible before you print the panel. After you print, you set those controls back to being visible again. Do not make these invisible. If their control attributes for visibility is set to false when you print, you will not see them on the printout.

The reason that you do not see on the display that they are invisible is because you change them back to being visible before you leave the callback (the user interface does not get updated during that time). If you comment out the three lines where you turn the controls back to visible, you will see that right a
fter you exit the print callback function, the very controls that had been missing from the printout are no longer visible on the panel on the screen.

Aaron B.
National Instruments
0 Kudos
Message 15 of 16
(722 Views)
Aaron,
Thanks for your help. When I had looked at that routine and seen the references to the controls on other forms, it had not occurred to me that those references were simply integer values that would refer to some control on any form that was being printed. So, my panels are printing correctly now, and I have hopefully learned a lesson about C as well. Thanks again.
0 Kudos
Message 16 of 16
(722 Views)