PrintDataWindow PowerScript function
Description
Prints the contents of a DataWindow control or DataStore as
a print job.
Syntax
1 |
<span>PrintDataWindow</span> ( <span>printjobnumber</span>, <span>dwcontrol</span> ) |
Argument |
Description |
---|---|
printjobnumber |
The number the PrintOpen function assigned |
dwcontrol |
The name of the DataWindow control, child |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs. If any argument’s value is null, PrintDataWindow returns null.
Usage
Do not use PrintDataWindow with any Print
functions except PrintOpen and PrintClose.
When you use PrintDataWindow with PrintOpen and PrintClose,
you can print several DataWindows in one print job. The information
in each DataWindow control starts printing on a new page.
When you print a DataWindow using PrintDataWindow,
PowerBuilder uses the fonts and layout specified in the computer’s
printer setup, not the fonts and layout specified in the DataWindow.
The PrintDefineFont and PrintSetFont methods
also have no effect.
When the DataWindow’s presentation style is RichTextEdit,
each row begins a new page in the printed output.
For information on skipping individual pages
with return codes in the PrintPage event, see the Print function.
Examples
These statements send the contents of three DataWindow
controls to the current printer in a single print job:
1 |
long job |
1 |
job = PrintOpen( ) |
1 |
// Each DataWindow starts printing on a new page. |
1 |
PrintDataWindow(job, dw_EmpHeader) |
1 |
PrintDataWindow(job, dw_EmpDetail) |
1 |
PrintDataWindow(job, dw_EmpDptSum) |
1 |
PrintClose(job) |