Tech Tip: 4D View Pro Overflow in Cells
PRODUCT: 4D View Pro | VERSION: 17 | PLATFORM: Mac & Win
Published On: February 22, 2019
Cells in 4D View Pro are a certain size and sometimes the data can expand beyond that. When that happens, based on the overflow property the data may overflow onto the adjacent cells in the column of become cut off.
By Default 4D View Pro has the property enabled.
As shown below the first image does not have overflow enabled while the second does
Below are two utility methods, one to get the overflow property and one to get the overflow proerty:
// Method: VP_SetOverFlow // Description // Allows the overflow property of a View Pro area // to be enabled or disabled // // Parameters // $1 - Text name of the View Pro area // $2 - Boolean value True to enable overflow and // False to disable // ---------------------------------------------------- C_TEXT($1;$areaName_t) C_BOOLEAN($2) C_TEXT($overflow_b) C_TEXT($jsCode_t) C_TEXT($res_t) If (Count parameters=2) $areaName_t:=$1 $overflow_b:=Lowercase(String($2)) $jsCode_t:="spread.getActiveSheet().options.allowCellOverflow = " $jsCode_t:=$jsCode_t+$overflow_b $jsCode_t:=$jsCode_t+";" $res_t:=WA Evaluate JavaScript(*;$areaName_t;$jsCode_t) End if |
Example of using the method:
// If View Pro Area Object name on a form is "vpAreaName" // enables overflow: VP_SetOverFlow ("vpAreaName";True) // disables overflow: VP_SetOverFlow ("vpAreaName";False) |
// Method: VP_GetOverFlow // Description // Returns the overflow property of a View Pro area // // Parameters // $1 - Text name of the View Pro area // // Output // $0 - Boolean value True = Overflow is enabled // False = Overflow is diabled // ---------------------------------------------------- C_TEXT($1;$areaName_t) C_BOOLEAN($0) C_TEXT($jsCode_t) If (Count parameters=1) $areaName_t:=$1 $jsCode_t:="spread.getActiveSheet().options.allowCellOverflow;" $0:=WA Evaluate JavaScript(*;$areaName_t;$jsCode_t;Is boolean) End if |
Example of using the method:
// If View Pro Area Object name on a form is "vpAreaName" C_BOOLEAN($result_b) $result_b:=VP_GetOverFlow("vpAreaName") |