4D View v16

PV Get row height

Home

 
4D View v16
PV Get row height

PV Get row height 


 

PV Get row height ( area ; row ) -> Function result 
Parameter Type   Description
area  Longint in 4D View area
row  Longint in Row number
Function result  Integer in Row height in pixels

The PV Get row height command returns the height (in pixels) of the specified row.

Refer to the example for the PV SET COLUMNS WIDTH command.

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

 
PROPERTIES 

Product: 4D View
Theme: PV Columns and Rows
Number: 15951

 
HISTORY 

Modified: 4D View 2004.5

 
ARTICLE USAGE

4D View Language ( 4D View v16)