4D v14.3

LISTBOX GET PRINT INFORMATION

Home

 
4D v14.3
LISTBOX GET PRINT INFORMATION

LISTBOX GET PRINT INFORMATION 


 

LISTBOX GET PRINT INFORMATION ( {* ;} object ; selector ; info ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a variable
object  Form object in Object name (if * is specified) or Variable (if * is omitted)
selector  Longint in Information to get
info  Longint, Boolean in Current value

The LISTBOX GET PRINT INFORMATION command returns the current information relative to the printing of the list box object designated by the object and * parameters. This command can be used to control the printing of the list box contents.

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a variable. In this case, you pass a variable reference instead of a string. 

This command must be called in the context of the printing of a list box via the Print object command. Outside of this context, it will not return significant values.

Pass a value indicating the information you want to find out in selector and a variable of the number or BLOB type in info. In selector, you can pass one of the following constants, found in the "List Box" theme:

Constant Type Value Comment
Listbox last printed row number Longint 0 Returns in info the number of the last row printed. Lets you find out the number of the next row to be printed.
The number returned may be greater than the number of rows actually printed if the list box contains invisible rows or if the OBJECT SET SCROLL POSITION command has been called. For example, if rows 1, 18 and 20 have been printed, info is 20. 
Listbox printed height Longint 3 Returns in info the height in pixels of the object actually printed (including headers, lines, etc.). Remember that if the number of rows to print is less than the "capacity" of the list box, its height is automatically reduced. 
Listbox printed rows Longint 1 Returns in info the number of rows actually printed during the last call to the Print object command. This number includes any break rows added in the case of a hierarchical list box. For example, info is 10 if the list box contains 20 rows and the odd-numbered rows were hidden.
Listbox printing is over Longint 2 Returns in info a Boolean indicating whether the last (visible) row of the list box has actually been printed. True = row has been printed; Otherwise, False.

For more information about the principles of printing list boxes, please refer to Printing list boxes.

Printing until all the rows have been printed:

 OPEN PRINTING JOB
 FORM LOAD("SalesForm")
 
 $Over:=False
 Repeat
    $Total:=Print object(*;"mylistbox")
    LISTBOX GET PRINT INFORMATION(*;"mylistbox";Listbox printing is over;$Over)
    PAGE BREAK
 Until($Over)
 
 CLOSE PRINTING JOB

Printing at least 500 rows of the list box, knowing that certain rows are hidden:

 $GlobalPrinted:=0
 Repeat
    $Total:=Print object(*;"mylistbox")
    LISTBOX GET PRINT INFORMATION(*;"mylistbox";Listbox printed rows;$Printed)
    $GlobalPrinted:=$GlobalPrinted+$Printed
    PAGE BREAK
 Until($GlobalPrinted>=500)

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1110

 
HISTORY 

Created: 4D v12

 
ARTICLE USAGE

4D Language Reference ( 4D v14.3)

Inherited from : LISTBOX GET PRINT INFORMATION ( 4D v12.4)