Admin Production ni-theme
Current Publication

PrintPanel

LabWindows/CVI

PrintPanel

int PrintPanel (int panelHandle, char filename[], int scaling, int scope, int confirmDialogBox);

Purpose

Prints the selected panel.

While this function is printing, it blocks any other thread in your program that attempts to print.

Remember that LabWindows/CVI maintains only one copy of the print attributes you set with SetPrintAttribute. Thus, when you change a print attribute in one thread, the change affects printing functions you subsequently call in other threads.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
filename char [] Name of the output file.

If the name is not empty, the output is redirected to the file.

If the name is not a complete pathname, the file is created relative to the current working directory.
scaling int Selects the scaling mode for printing.

Specify a nonzero value or select full size in the function panel to expand the panel to full size.

Specify 0 or select relative to screen in the function panel to print the panel at the same relative location and size on paper as displayed on the screen.

Note   If ATTR_PAPER_HEIGHT or ATTR_PAPER_WIDTH is set to VAL_INTEGRAL_SCALE, this parameter is forced to full size.
scope int Selects the portion of the panel to print: VAL_VISIBLE_AREA or VAL_FULL_PANEL.

VAL_VISIBLE_AREA—Prints only the portion of the panel that is visible on the screen. Menu bars, scroll bars, and a frame are printed along with the visible portion.

VAL_FULL_PANEL—Prints the entire panel. No menu bars, scroll bars, or frames print.

Note Note  If you select VAL_VISIBLE_AREA, the panel title bar and frame have the appearance of child panels in the bitmap. This behavior occurs for both top-level panels and child panels.
Regardless of the scope, objects within child panels are clipped to the frame of the child panel.

Note    If the printout does not fit on the page, call SetPrintAttribute before PrintPanel to change the settings as follows:
  • Set ATTR_PRINT_AREA_WIDTH to VAL_INTEGRAL_SCALE.
  • Set ATTR_PRINT_AREA_HEIGHT to VAL_USE_ENTIRE_PAPER.
confirmDialogBox int Determines whether to display a dialog box before printing to confirm print attributes.

The dialog box shows the current print attribute values and to what extent the current printer supports them. The end-user can change the attribute values during run time.

Specify a nonzero value or select show in the function panel to display the dialog box.

Specify 0 or select hide in the function panel to omit the dialog box.

Return Value

Name Type Description
printStatus int The status of the print operation.

The PrintCtrl function returns a value that contains bit-fields.

Defined Constant Value
VAL_TOO_MANY_COPIES (1<<0)
VAL_NO_MULTIPLE_COPIES (1<<1)
VAL_NO_DUPLEX (1<<2)
VAL_NO_LANDSCAPE (1<<3)
VAL_CANT_FORCE_MONO (1<<4)
VAL_NO_SUCH_XRESOLUTION (1<<5)
VAL_NO_MULTIPLE_XRESOLUTIONS (1<<6)
VAL_NO_SUCH_YRESOLUTION (1<<7)
VAL_NO_MULTIPLE_YRESOLUTIONS (1<<8)
VAL_NO_SEPARATE_YRESOLUTION (1<<9)
VAL_USER_CANCEL (1<<10)

A negative value indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Examples

Refer to the following examples that use the PrintPanel function:

  • apps\uirview\uirview.cws

    Open example
  • userint\custctrl\cviogl\simple.cws

    Open example