Print.property

Description

Properties that control the printing of a DataWindow.

Applies to

DataWindows

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Print.property

Describe and Modify argument:

"DataWindow.Print.property { = value }"

SyntaxFromSql:

DataWindow ( Print.property = value )

Parameter

Description

property

A property for printing. Properties and their settings are listed in the table below.

value

The value to be assigned to the property. Value cannot be a DataWindow expression.

Property for Print

Value

Background

Whether the background settings of the DataWindow and controls display on the printed report.

Values are:

  • Yes – Display background on report. This feature is not supported when you use a picture as the DataWindow background.

  • No – (Default) Do not display background on report.

Painter: Print Shows Background option.

Buttons

Whether buttons display on the printed output.

Values are:

  • Yes – Buttons are displayed.

  • No – Buttons are not displayed.

Painter: Display Buttons – Print.

CanUseDefault Printer

Whether a report can be printed on the default system printer if the printer specified by the PrinterName property is not valid.

Painter: Can Use Default Printer option.

ClipText

Whether the text of a static text field on a printed page is clipped to the dimensions of the text field when the text field has no visible border setting.

Values are:

  • Yes – The printed text does not overrun the text field.

  • No – (Default) The entire text can overrun the text field.

Text is automatically clipped for text fields with visible border settings even if this property is not set.

Painter: Clip Text option.

Collate

Whether printing is collated. Note that collating is usually slower since the print is repeated to produce collated sets.

Values are:

  • Yes – (Default) Collate the pages of the print job.

  • No – Do not collate.

Painter: Collate Copies option.

Color

An integer indicating whether the printed output will be color or monochrome.

Values are:

  • 1 – Color

  • 2 – Monochrome

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

Columns

An integer specifying the number of newspaper-style columns the DataWindow will print on a page. For purposes of page fitting, the whole DataWindow is a single column. The default is 1.

Painter: Newspaper Columns Across option.

Columns.Width

An integer specifying the width of the newspaper-style columns in the units specified for the DataWindow.

Painter: Newspaper Columns Width option.

Copies

An integer indicating the number of copies to be printed.

The user can also specify this value in the system’s Print Setup dialog box if the printer driver supports it.

If you use both the Print.Copies property and the Print Setup dialog box to indicate that multiple copies should be printed, the total number of copies printed is the product of the two values.

CustomPage.Length

A long indicating the desired length of a custom paper size for printing. Use this property in conjunction with Print.CustomPage.Width and with Paper.Size set to 256.

CustomPage.Width

A long indicating the desired width of a custom paper size for printing. Use this property in conjunction with Print.CustomPage.Length and with Paper.Size set to 256.

DocumentName

A string containing the name that will display in the print queue when the user sends the contents of the DataWindow object to the printer.

Painter: Document Name option.

Duplex

An integer indicating duplex or double-sided printing for printers capable of duplex printing.

Values are:

  • 0 – Default

  • 1 – Normal (nonduplex) printing

  • 2 – Short-edge binding (the long edge of the page is horizontal)

  • 3 – Long-edge binding (the long edge of the page is vertical)

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

Filename

A string containing the name of the file to which you want to print the report. An empty string means send to the printer.

Painter: Cannot be set in painter.

Margin.Bottom

An integer indicating the width of the bottom margin on the printed page in the units specified for the DataWindow.

You can set Margin.Bottom when using SyntaxFromSql to generate DataWindow syntax.

Painter: Bottom Margin option.

Margin.Left

An integer indicating the width of the left margin on the printed page in the units specified for the DataWindow.

You can set Margin.Left when using SyntaxFromSql to generate DataWindow syntax.

Painter: Left Margin option.

Margin.Right

An integer indicating the width of the right margin on the printed page in the units specified for the DataWindow.

You can set Margin.Right when using SyntaxFromSql to generate DataWindow syntax.

Painter: Right Margin option.

Margin.Top

An integer indicating the width of the top margin on the printed page in the units specified for the DataWindow.

You can set Margin.Top when using SyntaxFromSql to generate DataWindow syntax.

Painter: Top Margin option.

Orientation

An integer indicating the print orientation. This property has no effect if the computer has no default printer.

Values are:

  • 0 – The default orientation for your printer

  • 1 – Landscape

  • 2 – Portrait

Painter: Paper Orientation option.

OverridePrintJob

Whether you want to override the print job print settings defined in the PrintOpen method with the print specifications of the DataWindow.

Values are:

  • Yes – Override the print job print settings.

  • No – (Default) Do not override the print job print settings.

Painter: Override Print Job option.

Page.Range

A string containing the numbers of the pages you want to print, separated by commas. You can also specify a range with a dash. For example, to print pages 1, 2, and 5 through 10, enter: "1,2, 5-10". The empty string means print all.

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

Page.RangeInclude

An integer indicating what pages to print within the desired range.

Values are:

  • 0 – Print all.

  • 1 – Print all even pages.

  • 2 – Print all odd pages.

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

Paper.Size

An integer indicating the size of the paper used for the output:

  • 0 – Default paper size for the printer

  • 1 – Letter 8 1/2 x 11 in

  • 2 – LetterSmall 8 1/2 x 11 in

  • 3 – Tabloid 17 x 11 in

  • 4 – Ledger 17 x 11 in

  • 5 – Legal 8 1/2 x 14 in

  • 6 – Statement 5 1/2 x 8 1/2 in

  • 7 – Executive 7 1/4 x 10 1/2 in

  • 8 – A3 297 x 420 mm

  • 9 – A4 210 x 297 mm

  • 10 – A4 Small 210 x 297 mm

  • 11 – A5 148 x 210 mm

  • 12 – B4 250 x 354 mm

  • 13 – B5 182 x 257 mm

  • 14 – Folio 8 1/2 x 13 in

  • 15 – Quarto 215 x 275 mm

  • 16 – 10x14 in

  • 17 – 11x17 in

  • 18 – Note 8 1/2 x 11 in

  • 19 – Envelope #9 3 7/8 x 8 7/8

  • 20 – Envelope #10 4 1/8 x 9 1/2

  • 21 – Envelope #11 4 1/2 x 10 3/8

  • 22 – Envelope #12 4 x 11 1/276

  • 23 – Envelope #14 5 x 11 1/2

  • 24 – C size sheet

  • 25 – D size sheet

  • 26 – E size sheet

  • 27 – Envelope DL 110 x 220 mm

  • 28 – Envelope C5 162 x 229 mm

  • 29 – Envelope C3 324 x 458 mm

  • 30 – Envelope C4 229 x 324 mm

  • 31 – Envelope C6 114 x 162 mm

  • 32 – Envelope C65 114 x 229 mm

  • 33 – Envelope B4 250 x 353 mm

  • 34 – Envelope B5 176 x 250 mm

  • 35 – Envelope B6 176 x 125 mm

  • 36 – Envelope 110 x 230 mm

  • 37 – Envelope Monarch 3.875 x 7.5 in

  • 38 – 6 3/4 Envelope 3 5/8 x 6 1/2 in

  • 39 – US Std Fanfold 14 7/8 x 11 in

  • 40 – German Std Fanfold 8 1/2 x 12 in

  • 41 – German Legal Fanfold 8 1/2 x 13 in

  • 255, 256 – User-defined paper size (see "Usage" below)

Painter: Paper Size option.

Paper.Source

An integer indicating the bin that will be used as the paper source. The integer you use depends on the tray number used by the printer. (To determine the actual bin setting, you can query the printer with a utility that makes API calls to the printer driver.)

Typical values are:

  • 0 – Default

  • 1 – Upper

  • 2 – Lower

  • 3 – Middle

  • 4 – Manual

  • 5 – Envelope

  • 6 – Envelope manual

  • 7 – Auto

  • 8 – Tractor

  • 9 – Smallfmt

  • 10 – Largefmt

  • 11 – Large capacity

  • 14 – Cassette

Painter: Paper Source option.

Preview

Whether the DataWindow object is displayed in preview mode.

Values are:

  • Yes – Display in preview mode.

  • No – (Default) Do not display in preview mode.

Preview.Background

Whether the background settings of the DataWindow and controls display in the print preview.

Values are:

  • Yes – Display in preview mode.

  • No – (Default) Do not display in preview mode.

Painter: Preview Shows Background option.

PrinterName

A string containing the name of the printer you want to use to print the DataWindow report. If the printer name is not specified or if the named printer cannot be found at runtime, print output can be directed to the default printer for the user’s machine by setting the CanUseDefaultPrinter property. Otherwise, an error is returned.

Painter: Printer Name option.

Prompt

Whether a Printer Setup dialog displays before a job prints so the user can change the paper or other settings for the current printer.

Values are:

  • Yes – (Default) Display a Printer Setup dialog.

  • No – Do not display a Printer Setup dialog.

Choosing Cancel in the Printer Setup dialog dismisses the Setup dialog; it does not cancel printing. To allow the user to cancel printing, see the Print method.

For DataStores, this property is ignored; a dialog is never displayed.

Painter: Prompt Before Printing check box.

Quality

An integer indicating the quality of the output.

Values are:

  • 0 – Default

  • 1 – High

  • 2 – Medium

  • 3 – Low

  • 4 – Draft

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

Scale

An integer specifying the scale of the printed output as a percent.

The scaling percentage is passed to the print driver. If you have problems with scaling, you might be using a driver that does not support scaling.

The user can specify the value in the system’s Print dialog box if the printer driver supports it.

For more information, see your print driver documentation.

Usage


In the painter

Select the DataWindow by deselecting all controls; then set values in the Properties view, Print Specifications tab.

To specify a user-defined paper size, set the Paper.Size property to 255 or 256, then set the Print.CustomPage.Length and Print.Custom.Page.Width properties to the desired size. With Paper.Size set to 255, Length and Width are in the units specified for the DataWindow on the General page in the Properties view. For example:

// DataWindow Units set to 1/1000 inch
dw1.Modify("DataWindow.Print.Paper.Size=255")
//9.875 inches long
dw1.Modify("DataWindow.Print.CustomPage.Length=9875")
//7.375 inches wide
dw1.Modify("DataWindow.Print.CustomPage.Width=7375") 

With Paper.Size set to 256, Length and Width are in millimeters:

dw1.Modify("DataWindow.Print.Paper.Size=256")
//25.4 centimeters long
dw1.Modify("DataWindow.Print.CustomPage.Length=254")
//19.5 centimeters wide
dw1.Modify("DataWindow.Print.CustomPage.Width=195") 

Examples

Example 1

strData = dw1.Object.DataWindow.Print.Scale

Example 2

dw1.Object.DataWindow.Print.Paper.Size = 3

Example 3

strData = dw1.Describe("DataWindow.Print.Scale")

Example 4

dw1.Modify("DataWindow.Print.Paper.Size = 3")

Example 5

dw1.Modify("DataWindow.Print.Margin.Top=500")

Example 6

dw1.Object.DataWindow.Print.Buttons = 'Yes'

Example 7

setting = dw1.Describe("DataWindow.Print.Buttons")

Example 8

dw1.Modify("DataWindow.Print.Buttons = 'Yes'")

See also