LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

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

When using PrintPanel to print a panel, one EditNumeric control simply does not show up on the printed page. All of the other controls (including a number of other EditNumeric controls) show up correctly. I am making Visible and invisible this control as well as others, depending on the value of controls on another panel. The correct controls are appearing on the screen in all cases. The PrintPanel also appears to work correctly for all but one set of visible controls, and in that case, just one of the controls fails to appear. Does anyone have any suggestions as to why this might be occurring?
0 Kudos
Message 1 of 16
(3,775 Views)
Hello,

In order to determine what seems to be causing this issue, it would be helpful to have a copy of your UIR file. Could you please attach a copy of just this file so that we can run a few tests on it? Thank you.

Aaron B.
National Instruments
0 Kudos
Message 2 of 16
(3,775 Views)
Here is uir file that is showing the problem.
0 Kudos
Message 3 of 16
(3,775 Views)
Hello,

I have been testing your uir today. It gave me a bit of trouble until I realized that every single one of your controls has an identical looking control directly under it. I am not sure what possible function this could have. I did not have trouble printing any of the controls. Which exact control does not print correctly? Does it not print when it is visable, or does it print when it is invisable? So far, I have not encountered any odd behavior, but I will keep looking.

Aaron B.
National Instruments
0 Kudos
Message 4 of 16
(3,775 Views)
Actually there are four controls in each location. The correct one is made visible (in the code) depending on two binary switches on another form. The control that does not print is PINTVL_2. When it is set to "visible" in the code, it shows up correctly on the panel, but does not show up when the print function is used for the panel. However, the other three controls in the same location, (for example, PINTVL_2_RTL) print correctly when they are the control visible on the panel when the print function is used. When PINTVL_2 is visible on the form, and the print function is called, there is only the panel background showing on the printout where the control should appear. All of the other controls show up correctly on the printout.
0 Kudos
Message 5 of 16
(3,775 Views)
Hello,

I have created a project using your uir that uses the PrintPanel function to print the visible items of the panel. The code in the callback function that executes when you hit the "Default" button on the panel changes the color of the four controls superimposed with the PINTVL_2 control (this is to ensure that you know which control of the four you are seeing on the panel). It then makes the other three invisible and keeps only PINTVL_2 visible. When I print the panel, I was not able to replicate the error that you are getting (PINTVL_2 shows up on the printout).

I am attaching my project and all necessary files in a zipped folder called, Print_Panel. Please run this code and try to print the panel when PINTVL_
2 is visible. Let me know if you still encounter the same problem.

Aaron B.
National Instruments
0 Kudos
Message 6 of 16
(3,775 Views)
When I tried loading up the project you sent, I got a message that I was trying to load files from a later version of CVI than I have. I am running 5.5. Is it possible for you to build the test in that version?
0 Kudos
Message 7 of 16
(3,775 Views)
Hello,

I do not have CVI 5.5 installed, but it should not be difficult to create a new project for CVI 5.5. If you are not able to open the workspace that I made, you can easily create a new project that has the exact same functionality. You should have the same exact uir and header file as I do. Just use the .c file that I generated and attach it to your project. If that doesn't work, here are the steps that I took to create the project:

Start with just the uir. Attach it to a new project. Save it to create a new header file and attach that to the project also. With the uir selected, choose Code>>"generate all code" from the menu bar. Select to attach it to the current project (with cnfg_fin callback
selected for the QuitUserInterface Callback). The only other additions to the code I made were to add a PrintPanel() function call in the print_pnl callback and the code to set attributes in the default callback. I would recommend copying and pasting from the code that I generated.

I hope that this is helpful. Good luck and let me know how everything works out.

Aaron Beitner
National Instruments
0 Kudos
Message 8 of 16
(3,775 Views)
I was able to get the sample project to run with the suggestions you gave me. As when you ran it, the control in question printed out correctly (as did all of the other controls on the form). So, do I conclude correctly that there is no known/obvious reason why, in my complete project, a control that is visible on the panel would not appear when it is printed using the PrintPanel function? Do you have any suggestions as to what I might be doing wrong?
0 Kudos
Message 9 of 16
(3,775 Views)
Hello,

It sounds like you are probably doing something in your code that is causing this behavior. I would try using the working code as a reference to make sure that you are following the correct syntax to get your panel to print. You may even want to copy and past code from one file to another to make sure that you are passing all of the correct parameters.

You may even consider using the working code as a base and copying the functionality of your application into it. I would add things a little bit at a time and keep testing the printing as you go. If everything works in the end, that's great. If not, you will at least be able to see what part of the code is causing the unusual beh
avior.

Aaron B.
National Instruments
0 Kudos
Message 10 of 16
(3,775 Views)