Occurs before each page of the DataWindow or DataStore is formatted for printing.
PocketBuilder event information Event ID: pbm_dwnprintpage
Argument |
Description |
---|---|
pagenumber |
Long by value. The number of the page about to be printed. |
copy |
Long by value. The number of the copy being printed. |
Set the return code to affect the outcome of the event:
0 Do not skip the page
1 Skip the page
For information on setting the return code in a particular environment, see “About return values for DataWindow events”.
Example 1 After a script prints a DataWindow control, you can limit the number of pages to be printed by suppressing every page after page 50.
This statement in a CommandButton’s Clicked event script prints the contents of the DataWindow control:
dw_1.Print()
This code in the PrintPage event of dw_1 cancels printing after reaching page 50:
IF pagenumber > 50 THEN This.PrintCancel()
Example 2 If you know every fifth page of the DataWindow contains the summary information you want, you can suppress the other pages with some arithmetic and a RETURN statement:
IF Mod(pagenumber / 5) = 0 THEN
RETURN 0
ELSE
RETURN 1
END IF
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |