PrintWindow

Prints a screenshot of a project screen. The screen does not need to be open and active; the function can print a screen running in the background or even closed screen file.

Function Group Execution Windows Embedded Thin Client
PrintWindow Graphic Asynchronous Supported Supported Supported
Note: This function cannot be used with Tasks or in the Global Procedures script.

Syntax

PrintWindow( strScreenName , optNumOrientation, optNumID, optStrMnemonicList )
strScreenName
The name of the screen to be printed. If this parameter is omitted, then the currently active screen will be printed. (This parameter must be omitted when executing the function on a Windows Embedded target system.)
optNumOrientation
A numeric flag specifying the paper orientation:
Value Description
0 Portrait
1 Landscape

Default value is 0.

Note: The optNumOrientation parameter is not supported when running the project on a Windows Embedded target system.
optNumID
The specific instance number of the screen. (The ID is assigned when the screen is opened with the Open function.) This is an optional parameter; the default ID is 0.
optStrMnemonicList
A string that describes how the custom properties of any generic objects or linked symbols in the screen will be completed when the screen is printed. This string has the following syntax…
#Label:Value

…where Label is the name of the property and Value is the tag, expression or literal value that the property will receive. You can declare two or more mnemonics, as long as they are separated by spaces. See the Examples section below for an example.

Note: The optStrMnemonicList parameter does not work for a screen that is already open; if the screen has been opened, then the custom properties have already received their default values.

Returned value

This function does not return any value.

Examples

Tag Name Expression
  PrintWindow( ) // Prints the currently active screen in portrait orientation.
  PrintWindow( "Main", 1 ) // Prints the "Main" screen in landscape orientation.
  PrintWindow( TagScreenName ) // Prints the screen specified by TagScreenName.
  PrintWindow( "Main", 1, 10 ) // Prints the "Main" screen with ID 10.
  PrintWindow ( "Main", 1, 0, "#Mne1:Tag1 #Mne2:Tag2" ) // Prints the "Main" screen, replacing the custom properties Mne1 and Mne2 with Tag1 and Tag2, respectively.
Tip: You can use this function to print graphical reports that include Alarm/Event Control and Trend Control objects.