Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 1 For printing a single DataWindow or DataStore – PB Docs 150 – PowerBuilder Library

Syntax 1 For printing a single DataWindow or DataStore – PB Docs 150

Syntax 1 For printing a single DataWindow or DataStore

Description

Sends the contents of a DataWindow control or DataStore object
to the printer as a print job.

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

[PowerBuilder]

[Web ActiveX]

Argument

Description

dwcontrol

The name of the DataWindow control, DataStore,
or child DataWindow that contains the information to be printed.

canceldialog (optional)

A boolean value indicating whether you
want to display a nonmodal dialog that allows the user to cancel
printing. Values are:

  • True – (Default)
    Display the dialog.

  • false – Do not display
    the dialog.

note.png Working with DataStore objects

When working with DataStores, the canceldialog argument must
always be set to false.

showprintdialog (optional)

A boolean value indicating whether you
want to display the system Print dialog box. Values are:

  • True – Display
    the dialog box

  • false – (default) Do
    not display the dialog box

note.png Working with DataStore objects

When working with DataStores, the showprintdialog argument
must always be set to false.

Return Values

Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, Print returns null.

Usage

Printed output uses the same fonts and layout that appear
on screen for the DataWindow object.

When the DataWindow object’s presentation style is
RichTextEdit, each row begins a new page in the printed output.

note.png PowerBuilder environment

PowerBuilder manages print jobs by opening the job, sending
data, and closing the job. When you use Syntax 1, print job management
happens automatically. You do not need to use the PrintOpen and PrintClose functions.

Use Syntax 1 to print the contents of a DataWindow object.
The Print method prints all the rows that have
been retrieved. To print several DataWindows as a single job, do
not use Print. Instead, open the print job with PrintOpen,
call the PowerScript system function PrintDataWindow for each
DataWindow, and close the job.

note.png Events for DataWindow printing

When you use Print for DataWindow controls
or DataStores, it triggers a PrintStart event just before any data
is sent to the printer (or spooler), a PrintPage event for each
page break, and a PrintEnd event when printing is complete.

The PrintPage event has return codes that let you control
whether the page about to be formatted is printed. You can skip
the upcoming page by returning a value of 1 in the PrintPage event.

Examples

The following statements are equivalent. Each sends
the contents of dw_employee to the current printer. The
Cancel dialog box displays, allowing the user to cancel the printing,
but the Print dialog box does not:

This statement sends the contents of dw_employee
to the current printer. The Print dialog box displays but the Cancel
dialog box does not:

See Also

  • PrintDataWindow in the PowerScript
    Reference


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x