Skip to main content
Version: Next

VP RESIZE TABLE

History
ReleaseChanges
19 R7Added

VP RESIZE TABLE ( rangeObj : Object; tableName : Text )

ParameterTypeDescription
rangeObjObject->New range for the table
tableNameText->Name of the table

Description

The VP RESIZE TABLE command changes the tableName size with regards to the rangeObj.

The following rules apply:

  • Headers must remain in the same row and the resulting table range must overlap the original table range.
  • If the row count of the resized table is inferior to the initial row count, values inside cropped rows or columns are kept if they were not bound to a data context, otherwise they are deleted.
  • If the table expands on cells containing data:
    • if rows are added, data is deleted,
    • if columns are added, data are kept and are displayed in new columns.

If tableName does not exist, nothing happens.

Example

You create a table with a data context:

var $context : Object
$context:=New object()

$context.col:=New collection
$context.col.push(New object("name"; "Smith"; "salary"; 10000))
$context.col.push(New object("name"; "Wesson"; "salary"; 50000))
$context.col.push(New object("name"; "Gross"; "salary"; 10500))

VP SET DATA CONTEXT("ViewProArea"; $context)

VP CREATE TABLE(VP Cells("ViewProArea"; 1; 1; 3; 3); "PeopleTable"; "col")

You want to add one column before and after the table as well as two empty rows. You can write:

VP RESIZE TABLE(VP Cells("ViewProArea"; 0; 1; 4; 6); "PeopleTable")

See also

VP CREATE TABLE
VP Get table range