Syntax 1 For DataWindows and DataStores
Description
Cancels the printing of a DataWindow or DataStore that was
printed using Syntax 1 of Print.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>PrintCancel</span> ( ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>PrintCancel</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
Return Values
Returns 1 if it succeeds and –1 if an error occurs.
If dwcontrol is null, PrintCancel returns
null.
Usage
PrintCancel cancels the printing of the
specified DataWindow or DataStore by deleting the spool file, if
any, and closing the job.
When you use the Print method to print
the DataWindow or DataStore, without using PrintOpen,
use Syntax 1 to cancel printing. When you use the PowerScript system
function PrintDataWindow to print a DataWindow as
part of a print job, use Syntax 2 to cancel 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. You can use PrintCancel
in the PrintStart or PrintPage event to cancel printing.
Examples
This statement sends the contents of the DataWindow
dw_employee to the current printer without displaying the
Cancel dialog:
1 |
dw_Employee.Print(FALSE) |
This statement in the PrintStart event cancels printing:
1 |
dw_employee.<span>PrintCancel</span>() |