LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does LabWindows provide any print capabilities other than PrintPanel?

I would like to know whether LabWindows provides any print functions other than PrintPanel.  I am creating a file in my program and ideally I would like to be able to do the following from a LabWindows callback:
 
    Popup a dialog asking the user to select the printer, the orientation and the number of copies.
 
If so, what print formats would be supported?  If not, do you know of any way that I could do this and not interfere with the LabWindows libraries?
Thanks,
Donna
    
0 Kudos
Message 1 of 5
(3,514 Views)
The command PrintTextFile prints a text file, but I figure you already know that 🙂 It doesn't display a dialog box like PrintPanel, unfortunately. Maybe you can try the Windows SDK command PrintDlg of PrintDlgEx. You have to define a structure before you do this, see the SDK help for details. I didn't try it myself but it seems to do what you want.
 
Good luck!
0 Kudos
Message 2 of 5
(3,505 Views)

Donna,

In order to allow your end user to chose those values, you have 3 possibilities:

1. When you pass 1 as the last parameter to the PrintPanel function, CVI will display an options dialog. The user can select the printer from this dialog, and also click on the Properties button to then select the orientation and the number of copies.

2. If you don't want to expose the user to all the options that are in that dialog, you can enable the ATTR_SYSTEM_PRINT_DIALOG_ONLY print attribute. When you do so, the dialog that PrintPanel displays is the settings dialog for the default printer (the same dialog that comes up when you click on Properties from the CVI dialog). This will allow the user to select the orientation and number of copies, but not the printer.

3. You can create and display a custom panel that allows the user to specify all three of these options. Then you can read the user's choices, and programmatically configure CVI to use those settings, by setting the corresponding print attributes (look at the SetPrintAttribute documentation for information on the specific attributes to use).

Luis
NI

0 Kudos
Message 3 of 5
(3,483 Views)

Luis,

Can I use the three possibilites that you described for the PrintTextFile command?  I actually want to print a text file and not a panel.

Thanks,

Donna

0 Kudos
Message 4 of 5
(3,480 Views)
Unfortunately, the PrintTextFile does not allow you to display the dialog when you print, so you can only use the 3rd option.
 
Luis
0 Kudos
Message 5 of 5
(3,454 Views)