PV Get row height
version 2004.5 (Modified)
PV Get row height (area; row) Integer
Parameter | Type | Description | |
area | Longint | 4D View area | |
row | Longint | Row number |
Function result Integer Row height in pixels
Description
The PV Get row height command returns the height (in pixels) of the specified row.
Examples
1. Refer to the example for the PV SET COLUMNS WIDTH command.
2. Since 4D version 2004.5, the Print form command can be used to print 4D View areas. Generally, these areas are printed with a fixed height. The following example shows how to use the print commands of 4D and the PV Get row height command in order to vary the printing height of the 4D View area depending on its contents.
• Here is the form method called by the Print form command:
If(Form event=On Printing Detail)
GET OBJECT RECT(4DViewarea;$left;$top;$right;$bottom)
$posmarker:=Get print marker(Form Detail)
$areaheight:=$bottom-$top
$newheight:=4DViewSizeCalcul
` 4DViewSizeCalcul returns the height of the 4D View area depending on its contents
` This method is shown below
$offset:=$newheight-$areaheight
MOVE OBJECT(4DViewarea;0;0;0;$offset)
SET PRINT MARKER(Form Detail;$posmarker+$offset)
End if
• The 4DViewSizeCalcul method is as follows:
$area:=PV New offscreen area
PV BLOB TO AREA ($area;[Table 1]View_)
PV EXECUTE COMMAND ($area;pv cmd edit go to last cell)
PV GET CURRENT CELL ($area;$column;$row)
$height:=0
For ($i;1;$row)
$rowHeight:=PV Get row height ($area;$i)
$height:=$height+$rowHeight
End for
PV DELETE OFFSCREEN AREA ($area)
$0:=Trunc($height*0.75;0)
See Also
PV Get column width, PV SET ROWS HEIGHT.