Liste des méthodes
Warning: The commands on this page are not thread-safe.
A - C - D - E - F - G - I - M - N - O - P - R - S
A
VP ADD FORMULA NAME
VP ADD FORMULA NAME ( vpAreaName : Text ; vpFormula : Text ; name : Text { ; options : Object } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
vpFormula | Text | -> | Formule 4D View Pro | |
name | Text | -> | Nom de la formule | |
options | Object | -> | Options for the named formula |
Description
The VP ADD FORMULA NAME
command creates or modifies a named formula in the open document.
Les formules nommées créées par cette commande sont stockées dans le document.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the 4D View Pro formula that you want to name in vpFormula. For detailed information about formula syntax, see Formulas and Functions page.
Pass the new name for the formula in name. Si le nom est déjà utilisé dans le même scope, la nouvelle formule nommée remplace la formule existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous).
You can pass an object with additional properties for the named formula in options. Les propriétés suivantes sont prises en charge :
Propriété | Type | Description |
---|---|---|
scope | Number | Scope de la formule. You can pass the sheet index (counting begins at 0) or use the following constants: vk current sheet vk workbook vk current sheet ), or global across the entire workbook (scope=vk workbook ). |
comment | Text | Commentaire associé à une formule nommée |
Exemple
VP ADD FORMULA NAME("ViewProArea";"SUM($A$1:$A$10)";"Total2")
Voir également
Cell references
VP Get formula by name
VP Get names
VP ADD RANGE NAME
VP ADD RANGE NAME ( rangeObj : Object ; name : Text { ; options : Object } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
name | Text | -> | Nom de la formule | |
options | Object | -> | Options for the named formula |
Description
The VP ADD RANGE NAME
command creates or modifies a named range in the open document.
Les plages nommées créées par cette commande sont stockées dans le document.
In rangeObj, pass the range that you want to name and in name, pass the new name for the range. Si le nom est déjà utilisé dans le même scope, la nouvelle plage nommée remplace la plage existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous).
You can pass an object with additional properties for the named range in options. Les propriétés suivantes sont prises en charge :
Propriété | Type | Description |
---|---|---|
scope | Number | Scope de la plage. You can pass the sheet index (counting begins at 0) or use the following constants: vk current sheet vk workbook vk current sheet ), or global across the entire workbook (scope=vk workbook ). |
comment | Text | Commentaire associé à une plage nommée |
- Une plage nommée est en réalité une formule nommée contenant des coordonnées.
VP ADD RANGE NAME
facilitates the creation of named ranges, but you can also use theVP ADD FORMULA NAME
method to create named ranges.- Formulas defining named ranges can be retrieved with the
VP Get formula by name
method.
Exemple
Vous souhaitez créer une plage nommée à partir d'une plage contenant une cellule :
$range:=VP Cell("ViewProArea";2;10)
VP ADD RANGE NAME($range;"Total1")
Voir également
VP ADD SELECTION
VP ADD SELECTION ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Text | -> | Objet plage |
Description
The VP ADD SELECTION
command adds the specified cells to the currently selected cells.
In rangeObj, pass a range object of cells to add to the current selection.
La cellule active n'est pas modifiée.
Exemple
Les cellules sélectionnées sont les suivantes :
Le code suivant ajoutera des cellules à votre sélection :
$currentSelection:=VP Cells("myVPArea";3;4;2;3)
VP ADD SELECTION($currentSelection)
Résultat:
Voir également
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP ADD SHEET
VP ADD SHEET ( vpAreaName : Text )
VP ADD SHEET ( vpAreaName : Text ; index : Integer )
VP ADD SHEET ( vpAreaName : Text ; sheet : Integer ; name : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Indice de la nouvelle feuille | |
name | Text | -> | Nom de la feuille |
Description
The VP ADD SHEET
command inserts a sheet in the document loaded in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, you can pass an index for the new sheet. If the passed index is inferior to or equal to 0, the command inserts the new sheet at the beginning. If index exceeds the number of sheets, the command inserts the new sheet after the existing ones.
La numérotation démarre à 0.
In name, you can pass a name for the new sheet. The new name cannot contain the following characters: *, :, [, ], ?,\,/
Exemple
Le document comporte actuellement 3 feuilles :
Pour insérer une feuille à la troisième position (index 2) et la nommer "March" :
VP ADD SHEET("ViewProArea";2;"March")
Voir également
VP ADD SPAN
VP ADD SPAN ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP ADD SPAN
command combines the cells in rangeObj as a single span of cells.
In rangeObj, pass a range object of cells. Les cellules de la plage sont jointes, afin de créer une cellule plus large qui s'étend sur plusieurs colonnes et/ou lignes. Vous pouvez passer plusieurs plages de cellules pour créer plusieurs fusions de cellules en même temps. A noter que si les plages de cellules se chevauchent, seule la première plage est utilisée.
- Seules les données contenues dans la cellule supérieure gauche sont affichées. Les données des autres cellules combinées sont cachées jusqu'à ce que la fusion soit retirée.
- Les données masquées, contenues dans les cellules fusionnées, sont accessibles via des formules (commençant par la cellule supérieure gauche).
Exemple
Pour fusionner les cellules First quarter et Second quarter avec les deux cellules côte à côte, et de fusionner la cellule South area avec les deux lignes en-dessous :
// First quarter range
$q1:=VP Cells("ViewProArea";2;3;3;1)
// Second quarter range
$q2:=VP Cells("ViewProArea";5;3;3;1)
// South area range
$south:=VP Cells("ViewProArea";0;5;1;3)
VP ADD SPAN(VP Combine ranges($q1;$q2;$south))
Voir également
4D View Pro Range Object Properties
VP Get spans
VP REMOVE SPAN
VP ADD STYLESHEET
VP ADD STYLESHEET ( vpAreaName : Text ; styleName : Text ; styleObj : Object { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
styleName | Text | -> | Nom du style | |
styleObj | Object | -> | Objet définissant les propriétés de l'attribut | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP ADD STYLESHEET
command creates or modifies the styleName style sheet based upon the combination of the properties specified in styleObj in the open document. Si une feuille de style ayant le même nom et le même index existe déjà dans le document, cette commande l'écrasera et le remplacera avec les nouvelles valeurs.
Les feuilles de style créées par cette commande sont sauvegardées avec le document.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The styleName parameter lets you assign a name to the style sheet. Si le nom existe déjà dans le même scope, la nouvelle feuille de style remplace la feuille existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous).
Within the styleObj, designate the settings for the style sheet (e.g., font, text decoration, alignment, borders, etc.). For the full list of style properties, see Style object properties.
You can designate where to define the style sheet in the optional sheet parameter using the sheet index (indexing starts at 0) or with the following constants:
vk current sheet
vk workbook
If a styleName style sheet is defined at the workbook level and at a sheet level, the sheet level has priority over the workbook level when the style sheet is set.
To apply the style sheet, use the VP SET DEFAULT STYLE or VP SET CELL STYLE commands.
Exemple
Le code suivant :
$styles:=New object
$styles.backColor:="green"
//Line Border Object
$borders:=New object("color";"green";"style";vk line style medium dash dot)
$styles.borderBottom:=$borders
$styles.borderLeft:=$borders
$styles.borderRight:=$borders
$styles.borderTop:=$borders
VP ADD STYLESHEET("ViewProArea";"GreenDashDotStyle";$styles)
//To apply the style
VP SET CELL STYLE(VP Cells("ViewProArea";1;1;2;2);New object("name";"GreenDashDotStyle"))
will create and apply the following style object named GreenDashDotStyle:
{
backColor:green,
borderBottom:{color:green,style:10},
borderLeft:{color:green,style:10},
borderRight:{color:green,style:10},
borderTop:{color:green,style:10}
}
Voir également
4D View Pro Style Objects and Style Sheets
VP Get stylesheet
VP Get stylesheets
VP REMOVE STYLESHEET
VP SET CELL STYLE
VP SET DEFAULT STYLE
VP All
VP All ( vpAreaName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Range object of all cells |
Description
The VP ALL
command returns a new range object referencing all cells.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Vous souhaitez définir une plage pour toutes les cellules de la feuille courante :
$all:=VP All("ViewProArea") // toutes les cellules de la feuille courante
Voir également
VP Cell
VP Cells
VP Column
VP Combine ranges
VP Name
VP Row
C
VP Cell
VP Cell ( vpAreaName ; column : Integer ; row : Integer ; Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | |
---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
column | Longint | -> | Indice de la colonne |
row | Longint | -> | Indice de la ligne |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Résultat | Object | <- | Objet plage d'une seule cellule |
Description
The VP Cell
command returns a new range object referencing a specific cell.
Cette commande s'applique aux plages d'une seule cellule. To create a range object for multiple cells, use the VP Cells command.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The column parameter defines the column of the cell range's position. Passez l'indice de la colonne dans ce paramètre.
The row parameter defines the row of the cell range's position. Passez l'indice de la ligne dans ce paramètre.
In the optional sheet parameter, you can indicate the index of the sheet where the range will be defined. If omitted or if you pass vk current sheet
, the current spreadsheet is used by default.
l'indexation démarre à 0.
Exemple
Vous souhaitez définir une plage pour la cellule de la feuille courante (sur la feuille courante) :
Le code est le suivant :
$cell:=VP Cell("ViewProArea";2;4) // C5
Voir également
VP All
VP Cells
VP Column
VP Combine ranges
VP Name
VP Row
VP Cells
VP Cells ( vpAreaName : Text ; column: Integer ; row: Integer ; columnCount : Integer ; rowCount : Integer { ; sheet : Integer } ) : Object
Historique
Version | Modifications |
---|---|
v17 R4 | Ajout |
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
column | Integer | -> | Indice de la colonne | |
row | Integer | -> | Indice de la ligne | |
columnCount | Integer | -> | Nombre de colonnes | |
rowCount | Integer | -> | Nombre de lignes | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Objet plage de toutes les cellules |
Description
The VP Cells
command returns a new range object referencing specific cells.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The column parameter defines the first column of the cell range. Passez l'indice de la colonne (la numérotation commence à zéro) dans ce paramètre. If the range is within multiple columns, you should also use the columnCount parameter.
In the row parameter, you can define the row(s) of the cell range's position. Passez l'indice de la ligne (la numérotation commence à zéro) dans ce paramètre. If the range is within multiple rows, you should also use the rowCount parameter.
The columnCount parameter allows you to define the total number of columns the range is within. columnCount must be greater than 0.
The rowCount parameter allows you to define the total number of rows the range is within. rowCount must be greater than 0.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used by default.
Exemple
Vous souhaitez définir un objet plage pour les cellules suivantes (de la feuille courante) :
Le code est le suivant :
$cells:=VP Cells("ViewProArea";2;4;2;3) // de C5 à D7
Voir également
VP All
VP Cells
VP Column
VP Combine ranges
VP Name
VP Row
VP Column
VP Column ( vpAreaName : Text ; column: Integer ; columnCount : Integer { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
column | Integer | -> | Indice de la colonne | |
columnCount | Integer | -> | Nombre de colonnes | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Objet plage de toutes les cellules |
Description
The VP Column
command returns a new range object referencing a specific column or columns.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The column parameter defines the first column of the column range. Passez l'indice de la colonne (la numérotation commence à zéro) dans ce paramètre. If the range contains multiple columns, you should also use the optional columnCount parameter.
The optional columnCount parameter allows you to define the total number of columns of the range. columnCount must be greater than 0. Si le paramètre est omis, la valeur 1 sera définie par défaut et une plage de type colonne sera créée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used by default.
Exemple
Vous souhaitez définir une plage pour la colonne ci-dessous (dans la feuille courante) :
Le code est le suivant :
$column:=VP Column("ViewProArea";3) // column D
Voir également
VP All
VP Cells
VP Column
VP Combine ranges
VP Name
VP Row
VP SET COLUMN ATTRIBUTES
VP COLUMN AUTOFIT
VP COLUMN AUTOFIT ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP COLUMN AUTOFIT
command automatically sizes the column(s) in rangeObj according to their contents.
In rangeObj, pass a range object containing a range of the columns whose size will be automatically handled.
Exemple
Les colonnes suivantes sont toutes de la même taille et n'affichent pas certaines parties du texte :
La sélection des colonnes et l'exécution du code suivant :
VP COLUMN AUTOFIT(VP Get selection("ViewProarea"))
... resizes the columns to fit the size of the contents:
Voir également
VP Combine ranges
VP Combine ranges ( rangeObj : Object ; otherRangeObj : Object {;...otherRangeObjN : Object } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
otherRangeObj | Object | -> | Objet plage | |
Résultat | Object | <- | Object containing a combined range |
Description
The VP Combine Ranges
command returns a new range object that incorporates two or more existing range objects. Toutes les plages doivent provenir de la même zone 4D View Pro.
In rangeObj, pass the first range object.
In otherRangeObj, pass another range object(s) to combine with rangeObj.
The command incorporates rangeObj and otherRangeObj objects by reference.
Exemple
Vous souhaitez combiner des plages de type cellule, colonne et ligne dans une nouvelle plage distincte :
$cell:=VP Cell("ViewProArea";2;4) // C5
$column:=VP Column("ViewProArea";3) // column D
$row:=VP Row("ViewProArea";9) // row 10
$combine:=VP Combine ranges($cell;$column;$row)
Voir également
VP All
VP Cells
VP Column
VP Combine ranges
VP Name
VP Row
VP SET COLUMN ATTRIBUTES
VP Convert from 4D View
VP Convert from 4D View ( 4DViewDocument : Blob ) : Object
Paramètres | Type | Description | |
---|---|---|---|
4DViewDocument | Blob | -> | Document 4D View |
Résultat | Object | <- | 4D View Pro object |
Description
The VP Convert from 4D View
command allows you to convert a legacy 4D View document into a 4D View Pro object.
Cette commande ne nécessite pas l'installation du plug-in 4D View dans votre environnement.
In the 4DViewDocument parameter, pass a BLOB variable or field containing the 4D View document to convert. La commande retourne un objet 4D View Pro dans lequel toutes les informations stockées à l'origine dans le document 4D View sont converties en attributs 4D View Pro.
Exemple
Vous souhaitez obtenir un objet 4D View Pro à partir d'une zone 4D View stockée dans un BLOB :
C_OBJECT($vpObj)
$vpObj:=VP Convert from 4D View($pvblob)
VP Convert to picture
VP Convert to picture ( vpObject : Object {; rangeObj : Object} ) : Picture
Paramètres | Type | Description | ||
---|---|---|---|---|
vpObject | Object | -> | Objet 4D View Pro contenant la zone à convertir | |
rangeObj | Object | -> | Objet plage | |
Résultat | Object | <- | SVG picture of the area |
Description
The VP Convert to picture
command converts the vpObject 4D View Pro object (or the rangeObj range within vpObject) to a SVG picture.
Cette commande est utile, par exemple :
- pour intégrer un document 4D View Pro dans un autre document, tel qu'un document 4D Write Pro
- pour imprimer un document 4D View Pro sans le charger dans une zone 4D View Pro.
In vpObject, pass the 4D View Pro object that you want to convert. This object must have been previously parsed using VP Export to object or saved using VP EXPORT DOCUMENT.
SVG conversion process requires that expressions and formats (cf. Cell Format) included in the 4D View Pro area be evaluated at least once, so that they can be correctly exported. Si vous convertissez un document qui n'a pas été évalué au préalable, les expressions ou les formats peuvent être rendus de manière inattendue.
In rangeObj, pass a range of cells to convert. Par défaut, si ce paramètre est omis, tout le contenu du document est converti.
Les contenus de document sont convertis en tenant compte de leurs attributs d'affichage, y compris les formats (voir la note ci-dessus), la visibilité des en-têtes, des colonnes et des lignes. La conversion des éléments suivants est prise en charge :
- Texte : style / police / taille / alignement / rotation / format
- Arrière-plan de cellule : couleur / image
- Bordure de cellule : épaisseur / couleur / style
- Fusion de cellules
- Images
- Hauteur de lignes
- Largeur de colonnes
- Visibilité : colonnes / lignes cachées.
Gridline visibility depends on document attribute defined with VP SET PRINT INFO.
Résultat
La commande retourne une image au format SVG.
Exemple
Vous souhaitez convertir une zone 4D View Pro en SVG, prévisualiser le résultat et l'envoyer dans une variable image :
C_OBJECT($vpAreaObj)
C_PICTURE($vPict)
$vpAreaObj:=VP Export to object("ViewProArea")
$vPict:=VP Convert to picture($vpAreaObj) //exporter toute la zone
Voir également
VP EXPORT DOCUMENT
VP Export to object
VP SET PRINT INFO
VP Copy to object
Historique
Version | Modifications |
---|---|
v19 R4 | Ajout |
VP Copy to object ( rangeObj : Object {; options : Object} ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
options | Object | -> | Options supplémentaires | |
Résultat | Object | <- | Objet retourné. Contains the copied data |
Description
The VP Copy to object
command copies the contents, style and formulas from rangeObj to an object.
In rangeObj, pass the cell range with the values, formatting, and formulas to copy. If rangeObj is a combined range, only the first one is used.
You can pass an optional options parameter with the following properties:
Propriété | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
copy | Boolean | True (default) to keep the copied values, formatting and formulas after the command executes. False to remove them. | ||||||||||||||
copyOptions | Longint | Spécifie ce qui est copié ou déplacé. Possible values:
|
The paste options defined in the workbook options are taken into account.
La commande retourne un objet qui contient les données copiées.
Exemple
Cet exemple de code copie d'abord le contenu, valeurs, formats et formules d'une plage dans un objet puis les colle dans une autre plage :
var $originRange; $targetRange; $dataObject; $options : Object
$originRange:=VP Cells("ViewProArea"; 0; 0; 2; 5)
$options:=New object
$options.copy:=True
$options.copyOptions:=vk clipboard options all
$dataObject:=VP Copy to object($originRange; $options)
$targetRange:=VP Cell("ViewProArea"; 4; 0)
VP PASTE FROM OBJECT($targetRange; $dataObject; vk clipboard options all)
Voir également
VP PASTE FROM OBJECT
VP MOVE CELLS
VP Get workbook options
VP SET WORKBOOK OPTIONS
VP CREATE TABLE
Historique
Version | Modifications |
---|---|
v19 R8 | Support of theme options: bandColumns , bandRows , highlightFirstColumn , highlightLastColumn , theme |
v19 R7 | Support of allowAutoExpand option |
v19 R6 | Ajout |
VP CREATE TABLE ( rangeObj : Object ; tableName : Text {; source : Text} {; options : cs.ViewPro.TableOptions} )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
tableName | Text | -> | Nom de la table | |
source | Text | -> | Nom de la propriété du Data context à afficher dans la table | |
options | cs.ViewPro.TableOptions | -> | Options supplémentaires |
Description
The VP CREATE TABLE
command creates a table in the specified range. Vous pouvez créer une table dans une plage de cellules pour faciliter la gestion et l'analyse d'un groupe de données connexes. A table typically contains related data in rows and columns, and takes advantage of a data context.
In rangeObj, pass the cell range where the table will be created.
In tableName, pass a name for the table. Le nom doit :
- être unique dans la feuille
- inclure au moins 5 caractères
- ne pas inclure d'espaces ou commencer par un nombre
In source, you can pass a property name of a data context to display its data in the table. This binds the table to the data context. When the data context is updated, the data displayed in the table is updated accordingly. The source property must contain a collection of objects and each element represents a row.
- If you don't specify a source, the command creates an empty table with the size defined in rangeObj.
- If the specified source cannot be fully displayed in the document, no table is created.
In the options parameter, pass an object of the cs.ViewPro.TableOptions
class that contains the table properties to set.
Within the options object, the tableColumns collection determines the structure of the table's columns. The length of the tableColumns collection must be equal to the range column count:
- When the column count in rangeObj exceeds the number of columns in tableColumns, the table is filled with additional empty columns.
- When the column count in rangeObj is inferior to the number of tableColumns, the table displays a number of columns that match the range's column count.
If you pass a source but no tableColumn option, the command generates columns automatically. In this case, rangeObj must be a cell range. Otherwise, the first cell of the range is used. When generating columns automatically, the following rules apply:
- If the data passed to the command is a collection of objects, the property names are used as column titles. Par exemple :
([{ LastName: \"Freehafer\", FirstName: \"Nancy\"},{ LastName: \"John\", FirstName: \"Doe\"})
Here the titles of the columns would be LastName
and FirstName
.
If the data passed to the command is a collection of scalar values, it must contain a collection of subcollections:
- La collection de premier niveau contient des sous-collections de valeurs. Chaque sous-collection définit une ligne. Passez une collection vide pour sauter une ligne. The number of values in the first subcollection determines how many columns are created.
- The subcollections' indices are used as column titles.
- Chaque sous-collection définit les valeurs des cellules de la ligne. Values can be
Integer
,Real
,Boolean
,Text
,Date
,Null
,Time
orPicture
. ATime
value must be an a object containing a time attribute, as described in VP SET VALUE.
This only works when generating columns automatically. You cannot use a collection of scalar data with the tableColumns option.
Exemple
Pour créer une table en utilisant un contexte de données :
// Définir un contexte de données
var $data : Object
$data:=New object()
$data.people:=New collection()
$data.people.push(New object("firstName"; "John"; "lastName"; "Smith"; "email"; "johnsmith@gmail.com"))
$data.people.push(New object("firstName"; "Mary"; "lastName"; "Poppins"; "email"; "marypoppins@gmail.com"))
VP SET DATA CONTEXT("ViewProArea"; $data)
// Définir les colonnes de la table
var $options : cs.ViewPro.TableOptions
$options:=cs.ViewPro.TableOptions.new()
$options.tableColumns:=New collection()
$options.tableColumns.push(cs.ViewPro.TableColumns.new("name"; "First name"; "dataField"; "firstName"))
$options.tableColumns.push(cs.ViewPro.TableColumns.new("name"; "Last name"; "dataField"; "lastName"))
$options.tableColumns.push(cs.ViewPro.TableColumns.new("name"; "Email"; "dataField"; "email"))
// Créer une table à partir de la collection "people"
VP CREATE TABLE(VP Cells("ViewProArea"; 1; 1; $options.tableColumns.length; 1); "ContextTable"; "people"; $options)
Voici le résultat :
Voir également
VP Find table
VP Get table column attributes
VP Get table column index
VP INSERT TABLE COLUMNS
VP INSERT TABLE ROWS
VP REMOVE TABLE
VP RESIZE TABLE
VP SET DATA CONTEXT
VP SET TABLE COLUMN ATTRIBUTES
VP SET TABLE THEME
D
VP DELETE COLUMNS
VP DELETE COLUMNS ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP DELETE COLUMNS
command removes the columns in the rangeObj.
In rangeObj, pass an object containing a range of columns to remove. Si la plage qui est passée contient :
- des lignes et des colonnes, seules les colonnes sont supprimées.
- uniquement des lignes, la commande ne fait rien.
Les colonnes sont supprimées de droite à gauche.
Exemple
Pour supprimer les colonnes sélectionnées par l'utilisateur (colonnes B, C et D de l'image ci-dessous) :
saisissez le code suivant :
VP DELETE COLUMNS(VP Get selection("ViewProArea"))
Voir également
VP DELETE ROWS
VP DELETE ROWS ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP DELETE ROWS
command removes the rows in the rangeObj.
In rangeObj, pass an object containing a range of rows to remove. Si la plage qui est passée contient :
- des lignes et des colonnes, seules les lignes sont supprimées.
- uniquement des colonnes, la commande ne fait rien.
Les lignes sont supprimées du bas vers le haut.
Exemple
Pour supprimer les lignes sélectionnées par l'utilisateur (lignes 1, 2 et 3 de l'image ci-dessous) :
saisissez le code suivant :
VP DELETE ROWS(VP Get selection("ViewProArea"))
Voir également
E
VP EXPORT DOCUMENT
Historique
Version | Modifications |
---|---|
v20 R2 | Support of .sjs documents |
VP EXPORT DOCUMENT ( vpAreaName : Text ; filePath : Text {; paramObj : Object} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
filePath | Text | -> | Chemin d'accès du document | |
paramObj | Object | -> | Options d'export |
Description
The VP EXPORT DOCUMENT
command exports the 4D View Pro object attached to the 4D View Pro area vpAreaName to a document on disk according to the filePath and paramObj parameters.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In filePath, pass the destination path and name of the document to be exported. Si vous ne spécifiez pas de chemin, le document sera sauvegardé au même niveau que le dossier Projet.
Vous pouvez préciser le format du document en incluant une extension après son nom :
- 4D View Pro (".4vp")
- Microsoft Excel (".xlsx")
- PDF (".pdf")
- CSV (".txt", or ".csv")
- SpreadJS document (".sjs")
If the extension is not included, but the format is specified in paramObj, the exported file will have the extension that corresponds to the format, except for the CSV format (no extension is added in this case).
The optional paramObj parameter allows you to define multiple properties for the exported 4D View Pro object, as well as launch a callback method when the export has completed.
Propriété | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format | text | (optionnel) S'il est présent, désigne le format du fichier exporté : ".4vp" (par défaut), ".csv", ".xlsx", ".pdf", ou ".sjs". You can use the following constants:vk 4D View Pro format vk csv format vk MS Excel format vk pdf format vk sjs format | |||||||||||||||||||||||||||
password | text | Microsoft Excel uniquement (optionnel) - Mot de passe utilisé pour protéger le document MS Excel | |||||||||||||||||||||||||||
formula | 4D.Function | Méthode callback à lancer lorsque l'export est terminé. L'utilisation d'une méthode callback est nécessaire lorsque l'export est asynchrone (ce qui est le cas pour les formats PDF et Excel) si vous avez besoin d'un code à exécuter après l'export. The callback method must be passed with the Formula command. See Passing a callback method (formula). | |||||||||||||||||||||||||||
valuesOnly | boolean | Précise que seules les valeurs issues de formules (le cas échéant) seront exportées. | |||||||||||||||||||||||||||
includeFormatInfo | boolean | True pour inclure les informations de formatage, sinon False (True par défaut). Les informations de formatage sont utiles dans certains cas, par exemple pour un export en SVG. On the other hand, setting this property to false allows reducing export time. | |||||||||||||||||||||||||||
includeBindingSource | boolean | 4DVP et Microsoft Excel uniquement. True (par défaut) pour exporter les valeurs du contexte de données courant en tant que valeurs de cellule dans le document exporté (les contextes de données eux-mêmes ne sont pas exportés). Sinon Faux. La liaison de cellule est toujours exportée. For data context and cell binding management, see VP SET DATA CONTEXT and VP SET BINDING PATH. | |||||||||||||||||||||||||||
sheet | number | PDF uniquement (optionnel) - Numéro de la feuille à exporter (débute à 0). -2=all visible sheets (default), -1=current sheet only | |||||||||||||||||||||||||||
pdfOptions | object | PDF only (optional) - Options for pdf export
| |||||||||||||||||||||||||||
csvOptions | object | CSV only (optional) - Options for csv export
| |||||||||||||||||||||||||||
sjsOptions | object | SJS only (optional) - Options for sjs export
| |||||||||||||||||||||||||||
customProperty | any | Propriété personnalisée qui sera disponible via le paramètre $3 dans la méthode de callback. |
Notes about Excel format:
- Lors de l'export d'un document 4D View Pro en un fichier au format Microsoft Excel, certains paramètres peuvent être perdus. Par exemple, les méthodes et formules 4D ne sont pas prises en charge par Excel. You can verify other settings with this list from SpreadJS.
- Exporting in this format is run asynchronously, use the
formula
property of the paramObj for code to be executed after the export.
Notes about PDF format:
- Lors de l'export d'un document 4D View Pro en un fichier au format PDF, les polices utilisées dans le document sont automatiquement intégrées dans le fichier PDF. Seules les polices OpenType (fichiers .OTF ou .TTF) ayant une table Unicode peuvent être intégrées. Si aucun fichier de polices valide n'est trouvé pour une police, une police par défaut est utilisée à sa place.
- Exporting in this format is run asynchronously, use the
formula
property of the paramObj for code to be executed after the export.
Notes about CSV format:
- Lors de l'export d'un document 4D View Pro en un fichier au format PDF, certains paramètres peuvent être perdus, car seuls le texte et les valeurs sont sauvegardés.
- Toutes les valeurs sont enregistrées sous la forme de chaînes entre guillemets. For more information on delimiter-separated values, see this article on Wikipedia.
- Exporting in this format is run asynchronously, use the
formula
property of the paramObj for code to be executed after the export.
Notes about SpreadJS file format:
- SpreadJS files are zipped files.
- Exporting in this format is run asynchronously, use the
formula
property of the paramObj for code to be executed after the export.
Once the export operation is finished, VP EXPORT DOCUMENT
automatically triggers the execution of the method set in the formula property of the paramObj, if used.
Passer une méthode callback (formula)
When including the optional paramObj parameter, the command allows you to use the Formula
command to call a 4D method which will be executed once the export has completed. La méthode callback recevra les valeurs suivantes dans des variables locales :
Paramètres | Type | Description | |
---|---|---|---|
param1 | text | The name of the 4D View Pro area object | |
param2 | text | Chemin d'accès de l'objet 4D View Pro exporté | |
param3 | object | A reference to the command's paramObj | |
param4 | object | Objet retourné par la méthode avec un message de statut | |
.success | boolean | Vrai si l'export est réussi, Faux sinon. | |
.errorCode | entier | Code d'erreur. | |
.errorMessage | text | Message d'erreur. |
Exemple 1
Vous souhaitez exporter le contenu de la zone "VPArea" vers un document 4D View Pro sur le disque :
var $docPath: Text
$docPath:="C:\\Bases\\ViewProDocs\\MyExport.4VP"
VP EXPORT DOCUMENT("VPArea";$docPath)
//MyExport.4VP is saved on your disk
Exemple 2
Vous souhaitez exporter la feuille courante au format PDF :
var $params: Object
$params:=New object
$params.format:=vk pdf format
$params.sheet:=-1
$params.pdfOptions:=New object("title";"Annual Report";"author";Current user)
VP EXPORT DOCUMENT("VPArea";"report.pdf";$params)
Exemple 3
Vous souhaitez exporter un document 4D View Pro au format ".xlsx" et appeler une méthode qui lance Microsoft Excel avec le document ouvert une fois que l'export est terminé :
$params:=New object
$params.formula:=Formula(AfterExport)
$params.format:=vp MS Excel format //".xlsx"
$params.valuesOnly:=True
VP EXPORT DOCUMENT("ViewProArea";"c:\\tmp\\convertedfile";$params)
AfterExport method:
#DECLARE($areaName : Text ; $filePath : Text ; $params : Object ; $status : Object )
If($status.success=False)
ALERT($status.errorMessage)
Else
LAUNCH EXTERNAL PROCESS("C:\\Program Files\\Microsoft Office\\Office15\\excel "+$filePath)
End if
Exemple 4
You want to export the current sheet to a .txt
file with pipe-separated values:
var $params : Object
$params:=New object
$params.range:=VP Cells("ViewProArea";0;0;2;5)
$params.rowDelimiter:="\n"
$params.columnDelimiter:="|"
VP EXPORT DOCUMENT("ViewProArea";"c:\\tmp\\data.txt";New object("format";vk csv format;"csvOptions";$params))
Voici le résultat :
Voir également
VP Convert to picture
VP Export to object
VP Column
VP Print
VP EXPORT TO BLOB
VP EXPORT TO BLOB ( vpAreaName : Text ; paramObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
paramObj | Object | -> | Options d'export |
Description
The VP EXPORT TO BLOB
command exports the vpAreaName 4D View Pro document in a 4D.Blob according to the paramObj options. The exported blob is available through the export callback. Exporting and importing 4D View Pro areas as blobs is fast and memory-efficient.
In paramObj, you can pass several properties:
Propriété | Type | Description |
---|---|---|
formula | 4D.Function | (mandatory) Callback method to be launched when the export has completed. See Passing a callback method (formula). |
includeAutoMergedCells | Boolean | Whether to include the automatically merged cells when saving, default=false. |
includeBindingSource | Boolean | Whether to include the binding source when saving, default=true. |
includeCalcModelCache | Boolean | Whether to include the extra data of calculation. Can impact the speed of opening the file, default=false. |
includeEmptyRegionCells | Boolean | Whether to include any empty cells(cells with no data or only style) outside the used data range, default=true |
includeFormulas | Boolean | Whether to include the formula when saving, default=true. |
includeStyles | Boolean | Whether to include the style when saving, default=true. |
includeUnusedNames | Boolean | Whether to include the unused custom name when saving, default=true. |
|saveAsView|Boolean|Whether to apply the format string to exporting value when saving, default=false.|
Les paramètres suivants peuvent être utilisés dans la méthode de rappel :
Paramètres | Type | Description | |
---|---|---|---|
param1 | text | Nom de l'objet 4D View Pro | |
param2 | 4D.blob | The exported blob | |
param3 | object | A reference to the command's paramObj parameter | |
param4 | object | Objet retourné par la méthode avec un message de statut | |
.success | boolean | Vrai si l'export est réussi, Faux sinon. | |
.errorCode | entier | Code d'erreur. | |
.errorMessage | text | Message d'erreur. |
Exemple
The command VP EXPORT TO BLOB
is asynchronous. You must create a callback method (named VPBlobCallback in our example) to use the export results.
//Export the VP document
VP EXPORT TO BLOB("ViewProArea"; {formula: Formula(VPBlobCallback)})
//VPBlobCallback method
#DECLARE($area : Text; $data : 4D.Blob; $parameters : Object; $status : Object)
var $myEntity : cs.myTableEntity
If ($status.success)
// Save the document in a table
$myEntity:=ds.myTable.new()
$myEntity.blob:=$data
$myEntity.save()
End if
Voir également
VP Export to object
VP Export to object ( vpAreaName : Text {; options : Object} ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
options | Object | -> | Options d'export | |
Résultat | Object | <- | Objet 4D View Pro |
Description
The VP Export to object
command returns the 4D View Pro object attached to the 4D View Pro area vpAreaName. Vous pouvez utiliser cette commande par exemple pour stocker la zone 4D View Pro dans un champ objet de la base de données 4D.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the options parameter, you can pass the following export options, if required:
Propriété | Type | Description |
---|---|---|
includeFormatInfo | Boolean | True (défaut) pour inclure les informations de formatage, sinon False. Les informations de formatage sont utiles dans certains cas, par exemple pour un export en SVG. D'un autre côté, mettre cette propriété à false permet de réduire la durée de l'export. |
includeBindingSource | Boolean | True (par défaut) pour exporter les valeurs du contexte de données courant en tant que valeurs de cellule dans l'objet exporté (les contextes de données eux-mêmes ne sont pas exportés). Sinon Faux. La liaison de cellule est toujours exportée. |
For more information on 4D View Pro objects, please refer to the 4D View Pro object paragraph.
Exemple 1
Vous souhaitez lire la propriété "version" de la zone 4D View Pro courante :
var $vpAreaObj : Object
var $vpVersion : Number
$vpAreaObj:=VP Export to object("vpArea")
// $vpVersion:=OB Get($vpAreaObj;"version")
$vpVersion:=$vpAreaObj.version
Exemple 2
Vous souhaitez exporter la zone, en excluant les informations de formatage :
var $vpObj : Object
$vpObj:=VP Export to object("vpArea";New object("includeFormatInfo";False))
Voir également
VP Convert to picture
VP EXPORT DOCUMENT
VP IMPORT FROM OBJECT
F
VP Find
VP Find ( rangeObj : Object ; searchValue : Text ) : Object
VP Find ( rangeObj : Object ; searchValue : Text ; searchCondition : Object } ) : Object
VP Find ( rangeObj : Object ; searchValue : Text ; searchCondition : Object ; replaceValue : Text ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
searchValue | Text | -> | Valeur de recherche | |
searchCondition | Object | -> | Objet contenant la/les condition(s) de recherche | |
replaceValue | Text | -> | Valeur de remplacement | |
Résultat | Object | <- | Objet plage |
Description
The VP Find
command searches the rangeObj for the searchValue. Des paramètres facultatifs peuvent être utilisés pour affiner la recherche et/ou remplacer les résultats trouvés.
In the rangeObj parameter, pass an object containing a range to search.
The searchValue parameter lets you pass the text to search for within the rangeObj.
You can pass the optional searchCondition parameter to specify how the search is performed. Les propriétés suivantes sont prises en charge :
Propriété | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
afterColumn | Integer | Le numéro de la colonne située juste avant la colonne de départ de la recherche. If the rangeObj is a combined range, the column number given must be from the first range. Default value: -1 (beginning of the rangeObj) | ||||||||
afterRow | Integer | Le numéro de la colonne située juste avant la colonne de départ de la recherche. If the rangeObj is a combined range, the row number given must be from the first range. Default value: -1 (beginning of the rangeObj) | ||||||||
all | Boolean | |||||||||
flags | Integer |
$search.flags:=vk find flag use wild cards+vk find flag ignore case | ||||||||
order | Integer |
| ||||||||
target | Integer |
These flags can be combined. For example: |
In the optional replaceValue parameter, you can pass text to take the place of any instance of the text in searchValue found in the rangeObj.
Objet retourné
La fonction retourne un objet de plage décrivant chaque valeur de recherche trouvée ou remplacée. Un objet de plage vide est retourné si aucun résultat n'est trouvé.
Exemple 1
Pour trouver la première cellule contenant le mot "Total" :
var $range;$result : Object
$range:=VP All("ViewProArea")
$result:=VP Find($range;"Total")
Exemple 2
Pour trouver "Total" et le remplacer par "Grand Total" :
var $range;$condition;$result : Object
$range:=VP All("ViewProArea")
$condition:=New object
$condition.target:=vk find target text
$condition.all:=True //Search entire document
$condition.flags:=vk find flag exact match
// Replace the cells containing only 'Total' in the current sheet with "Grand Total"
$result:=VP Find($range;"Total";$condition;"Grand Total")
// Check for empty range object
If($result.ranges.length=0)
ALERT("No result found")
Else
ALERT($result.ranges.length+" results found")
End if
VP Find table
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP Find table ( rangeObj : Object ) : Text
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Plage de cellule | |
Résultat | Text | <- | Nom de table |
Description
The VP Find table
command returns the name of the table to which to the rangeObj cell belongs.
In rangeObj, pass a cell range object. Si les cellules désignées n'appartiennent pas à une table, la commande retourne une chaîne vide.
If rangeObj is not a cell range or contains multiple ranges, the first cell of the first range is used.
Exemple
If (FORM Event.code=On After Edit && FORM Event.action="valueChanged")
$tableName:=VP Find table(FORM Event.range)
If ($tableName#"")
ALERT("The "+$tableName+" table has been modified.")
End if
End if
Voir également
VP FLUSH COMMANDS
VP FLUSH COMMANDS ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
Description
The VP FLUSH COMMANDS
command immediately executes stored commands and clears the command buffer.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Afin d'améliorer la performance et de réduire le nombre de requêtes envoyées, les commandes 4D View Pro appelées par le développeur sont stockées temporairement dans un buffer de commandes. When called, VP FLUSH COMMANDS
executes the commands as a batch when leaving the method and empties the contents of the command buffer.
Exemple
Vous souhaitez tracer l'exécution des commandes et vider le buffer :
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;1);"INVOICE")
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;2);"Invoice date: ")
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;3);"Due date: ")
VP FLUSH COMMANDS(("ViewProArea1")
TRACE
VP Font to object
VP Font to object ( font : Text ) : Object
Paramètres | Type | Description | |
---|---|---|---|
font | Text | -> | Chaîne raccourcie pour la police (shorthand) |
Résultat | Object | <- | Objet police |
Description
The VP Font to object
utility command returns an object from a font shorthand string. .
In the font parameter, pass a font shorthand string to specify the different properties of a font (e.g., "12 pt Arial"). You can learn more about font shorthand strings in this page for example.
L'objet retourné contient les attributs de police définis comme propriétés. For more information about the available properties, see the VP Object to font command.
Exemple 1
Le code suivant :
$font:=VP Font to object("16pt arial")
retournera l'objet $font suivant :
{
family:arial
size:16pt
}
Exemple 2
See example for VP Object to font
.
Voir également
4D View Pro Style Objects and Style Sheets
VP Object to font
VP SET CELL STYLE
VP SET DEFAULT STYLE
G
VP Get active cell
VP Get active cell ( vpAreaName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Range object of single cell |
Description
The VP Get active cell
command returns a new range object referencing the cell which has the focus and where new data will be entered (the active cell).
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Le code suivant récupèrera les coordonnées de la cellule active :
$activeCell:=VP Get active cell("myVPArea")
//returns a range object containing:
//$activeCell.ranges[0].column=3
//$activeCell.ranges[0].row=4
//$activeCell.ranges[0].sheet=0
Voir également
VP ADD SELECTION
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP Get binding path
Historique
Version | Modifications |
---|---|
v19 R5 | Ajout |
VP Get binding path ( rangeObj : Object ) : Text
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Text | <- | Name of the attribute bound to the cell |
Description
The VP Get binding path
command returns the name of the attribute bound to the cell specified in rangeObj.
In rangeObj, pass an object that is either a cell range or a combined range of cells. A noter que :
- If rangeObj is a range with several cells, the command returns the attribute name linked to the first cell in the range.
- If rangeObj contains several ranges of cells, the command returns the attribute name linked to the first cell of the first range.
Exemple
var $p; $options : Object
var $myAttribute : Text
$p:=New object
$p.firstName:="Freehafer"
$p.lastName:="Nancy"
VP SET DATA CONTEXT("ViewProArea"; $p)
VP SET BINDING PATH(VP Cell("ViewProArea"; 0; 0); "firstName")
VP SET BINDING PATH(VP Cell("ViewProArea"; 1; 0); "lastName")
$myAttribute:=VP Get binding path(VP Cell("ViewProArea"; 1; 0)) // "lastName"
Voir également
VP SET BINDING PATH
VP Get data context
VP SET DATA CONTEXT
VP Get cell style
VP Get cell style ( rangeObj : Object ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Object | <- | Objet style |
Description
The VP Get cell style
command returns a style object for the first cell in the rangeObj.
In rangeObj, pass a range containing the style to retrieve.
- If rangeObj contains a cell range, the cell style is returned.
- If rangeObj contains a range that is not a cell range, the style of the first cell in the range is returned.
- If rangeObj contains several ranges, only the style of the first cell in the first range is returned.
Exemple
Pour obtenir les détails concernant le style de la cellule sélectionnée (B2) :
Le code suivant :
$cellStyle:=VP Get cell style(VP Get selection("myDoc"))
... will return this object:
{
"backColor":"Azure",
"borderBottom":
{
"color":#800080,
"style":5
}
"font":"8pt Arial",
"foreColor":"red",
"hAlign":1,
"isVerticalText":"true",
"vAlign":0
}
Voir également
VP GET DEFAULT STYLE
VP SET CELL STYLE
VP Get column attributes
VP Get column attributes ( rangeObj : Object ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Collection | <- | Collection of column properties |
Description
The VP Get column attributes
command returns a collection of properties for any column in the rangeObj.
In rangeObj, pass an object containing a range of the columns whose attributes will be retrieved.
The returned collection contains any properties for the columns, whether or not they have been set by the VP SET COLUMN ATTRIBUTES command.
Exemple
Le code suivant :
C_OBJECT($range)
C_COLLECTION($attr)
$range:=VP Column("ViewProArea";1;2)
$attr:=VP Get column attributes($range)
... will return a collection of the attributes within the given range:
Voir également
VP Get row attributes
VP SET COLUMN ATTRIBUTES
VP SET ROW ATTRIBUTES
VP Get column count
VP Get column count ( vpAreaName : Text { ; sheet : Integer } ) : Integer
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Integer | <- | Total number of columns |
Description
The VP Get column count
command returns the total number of columns from the designated sheet.
In vpAreaName, pass the name property of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can define where to get the column count in the optional sheet parameter using the sheet index (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Le code suivant retourne le nombre de colonnes dans la zone 4D View Pro :
C_INTEGER($colCount)
$colCount:=VP Get column count("ViewProarea")
Voir également
VP Get row count
VP SET COLUMN COUNT
VP SET ROW COUNT
VP Get current sheet
VP Get current sheet ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
Résultat | Integer | <- | Index of the current sheet |
Description
The VP Get current sheet
command returns the index of the current sheet in vpAreaName. The current sheet is the selected sheet in the document.
In vpAreaName, pass the name of the 4D View Pro area.
La numérotation démarre à 0.
Exemple
Lorsque la troisième feuille est sélectionnée :
La commande retourne 2 :
$index:=VP Get current sheet("ViewProArea")
Voir également
VP Get data context
Historique
Version | Modifications |
---|---|
v19 R5 | Ajout |
VP Get data context ( vpAreaName : Text {; sheet : Integer } ) : Object
VP Get data context ( vpAreaName : Text {; sheet : Integer } ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Indice de la feuille de laquelle obtenir le data context | |
Résultat | Object | Collection | <- | Data context |
Description
The VP Get data context
command returns the current data context of a worksheet. The returned context includes any modifications made to the contents of the data context.
In sheet, pass the index of the sheet to get the data context from. If no index is passed, the command returns the data context of the current worksheet. If there is no context for the worksheet, the command returns Null
.
The function returns an object or a collection depending on the type of data context set with VP SET DATA CONTEXT.
Exemple
To get the data context bound to the following cells:
var $dataContext : Object
$dataContext:=VP Get data context("ViewProArea") // {firstName:Freehafer,lastName:Nancy}
Voir également
VP SET DATA CONTEXT
VP Get binding path
VP SET BINDING PATH
VP Get default style
VP Get default style ( vpAreaName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Default style settings |
Description
The VP Get default style
command returns a default style object for a sheet. The returned object contains basic document rendering properties as well as the default style settings (if any) previously set by the VP SET DEFAULT STYLE method. For more information about style properties, see Style Objects & Style Sheets.
In vpAreaName, pass the name property of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can define where to get the column count in the optional sheet parameter using the sheet index (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Pour lire les détails du style par défaut de ce document :
Le code suivant :
$defaultStyle:=VP Get default style("myDoc")
will return this information in the $defaultStyle object:
{
backColor:#E6E6FA,
hAlign:0,
vAlign:0,
font:12pt papyrus
}
Voir également
VP Get cell style
VP SET DEFAULT STYLE
VP Get formula
VP Get formula ( rangeObj : Object) : Text
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Text | <- | Formula |
Description
The VP Get formula
command retrieves the formula from a designated cell range.
In rangeObj, pass a range whose formula you want to retrieve. If rangeObj designates multiple cells or multiple ranges, the formula of the first cell is returned. If rangeObj is a cell that does not contain a formula, the method returns an empty string.
Exemple
//set a formula
VP SET FORMULA(VP Cell("ViewProArea";5;2);"SUM($A$1:$C$10)")
$result:=VP Get formula(VP Cell("ViewProArea";5;2)) // $result="SUM($A$1:$C$10)"
Voir également
VP Get formulas
VP SET FORMULA
VP SET ROW COUNT
VP Get formula by name
VP Get formula by name ( vpAreaName : Text ; name : Text { ; scope : Number } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
name | Text | -> | Nom de la plage nommée | |
scope | Number | -> | "Scope" cible (par défaut=feuille courante) | |
Résultat | Object | <- | Named formula or named range definition |
Description
The VP Get formula by name
command returns the formula and comment corresponding to the named range or named formula passed in the name parameter, or null if it does not exist in the defined scope.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the named range or named formula that you want to get in name. A noter que les plages nommées sont retournées sous forme de formules contenant des références absolues de cellules.
You can define where to get the formula in scope using either the sheet index (counting begins at 0) or the following constants:
vk current sheet
vk workbook
Objet retourné
L'objet retourné contient les propriétés suivantes :
Propriété | Type | Description |
---|---|---|
formula | Text | Texte de la formule correspondant à la formule nommée ou à la plage nommée. Pour les plages nommées, la formule est une séquence de coordonnées absolues. |
comment | Text | Commentaire correspondant à la formule nommée ou à la plage nommée |
Exemple
$range:=VP Cell("ViewProArea";0;0)
VP ADD RANGE NAME("Total1";$range)
$formula:=VP Get formula by name("ViewProArea";"Total1")
//$formula.formula=Sheet1!$A$1
$formula:=VP Get formula by name("ViewProArea";"Total")
//$formula=null (if not existing)
Voir également
VP ADD FORMULA NAME
VP Get names
VP Get formulas
VP Get formulas ( rangeObj : Object ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Collection | <- | Collection of formula values |
Description
The VP Get formulas
command retrieves the formulas from a designated rangeObj.
In rangeObj, pass a range whose formulas you want to retrieve. If rangeObj designates multiple ranges, the formula of the first range is returned. If rangeObj does not contain any formulas, the command returns an empty string.
La collection retournée est bidemensionnelle :
- La collection de premier niveau contient des sous-collections de formules. Chaque sous-collection représente une ligne.
- Chaque sous-collection définit les valeurs des cellules de la ligne. Les valeurs sont des éléments textuels contenant les formules des cellules.
Exemple
Vous souhaitez récupérer les formules des colonnes Sum et Average de ce document :
Vous pouvez utiliser ce code :
$formulas:=VP Get formulas(VP Cells("ViewProArea";5;1;2;3))
//$formulas[0]=[Sum(B2:D2),Average(B2:D2)]
//$formulas[1]=[Sum(B3:D3),Average(B3:D3)]
//$formulas[2]=[Sum(B4:D4),Average(C4:D4)]
Voir également
VP Get formula
VP Get values
VP SET FORMULAS
VP SET VALUES
VP Get frozen panes
VP Get frozen panes ( vpAreaName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Objet contenant des informations sur les colonnes et lignes figées |
Description
The VP Get frozen panes
command returns an object with information about the frozen columns and rows in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Objet retourné
La commande retourne un objet décrivant les lignes et colonnes figées. Cet objet peut avoir les propriétés suivantes :
Propriété | Type | Description |
---|---|---|
columnCount | Integer | Le nombre de colonnes figées sur la gauche de la feuille |
trailingColumnCount | Integer | Le nombre de colonnes figées sur la droite de la feuille |
rowCount | Integer | Le nombre de lignes figées en haut de la feuille |
trailingRowCount | Integer | Le nombre de lignes figées en bas de la feuille |
Exemple
Vous souhaitez récupérer des informations sur le nombre de colonnes et de lignes figées :
var $panesObj : Object
$panesObj:=VP Get frozen panes("ViewProArea")
L'objet retourné contient, par exemple :
Voir également
VP Get names
VP Get names ( vpAreaName : Text { ; scope : Number } ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
scope | Number | -> | "Scope" cible (par défaut=feuille courante) | |
Résultat | Collection | <- | Existing names in the defined scope |
Description
The VP Get names
command returns a collection of all defined "names" in the current sheet or in the scope designated by the scope parameter.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can define where to get the names in scope using either the sheet index (counting begins at 0) or the following constants:
vk current sheet
vk workbook
Collection retournée
La collection retournée contient un objet par nom. Les propriétés d'objets suivantes peuvent être retournées :
Propriété | Type | Description |
---|---|---|
result[ ].name | Text | nom de cellule ou de plage |
result[ ].formula | Text | formula |
result[ ].comment | Text | Commentaire associé au nom |
Les propriétés disponibles dépendent du type d'élément nommé (cellule nommée, plage nommée ou formule nommée).
Exemple
var $list : Collection
$list:=VP Get names("ViewProArea";2) //noms de la 3e feuille
Voir également
VP ADD FORMULA NAME
VP ADD RANGE NAME
VP Get formula by name
VP Name
VP Get print info
VP Get print info ( vpAreaName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Object of printing information |
Description
The VP Get print info
command returns an object containing the print attributes of the vpAreaName.
Pass the the name of the 4D View Pro area in vpAreaName. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet (counting begins at 0) whose printing attributes you want returned. If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Le code suivant :
$pinfo:=VP Get print info("ViewProArea")
... returns the print attributes of the 4D View Pro area set in the VP SET PRINT INFO command:
{
bestFitColumns:false,
bestFitRows:false,
blackAndWhite:false,
centering:0,
columnEnd:8,
columnStart:0,
firstPageNumber:1,
fitPagesTall:1,
fitPagesWide:1,
footerCenter:"&BS.H.I.E.L.D. &A Sales Per Region",
footerCenterImage:,
footerLeft:,
footerLeftImage:,
footerRight:"page &P of &N",
footerRightImage:,
headerCenter:,
headerCenterImage:,
headerLeft:"&G",
headerLeftImage:logo.png,
headerRight:,
headerRightImage:,
margin:{top:75,bottom:75,left:70,right:70,header:30,footer:30},
orientation:2,
pageOrder:0,
pageRange:,
paperSize:{width:850,height:1100,kind:1},
qualityFactor:2,
repeatColumnEnd:-1,
repeatColumnStart:-1,
repeatRowEnd:-1,
repeatRowStart:-1,
rowEnd:24,
rowStart:0,
showBorder:false,
showColumnHeader:0,
showGridLine:false,
showRowHeader:0,
useMax:true,
watermark:[],
zoomFactor:1
}
Voir également
4D View Pro Print Attributes
VP SET PRINT INFO
VP Get row attributes
VP Get row attributes ( rangeObj : Object ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Collection | <- | Collection of row properties |
Description
The VP Get row attributes
command returns a collection of properties for any row in the rangeObj.
In rangeObj, pass an object containing a range of the rows whose attributes will be retrieved.
The returned collection contains any properties for the rows, whether or not they have been set by the VP SET ROW ATTRIBUTES method.
Exemple
Le code suivant retourne une collection d'attributs de la plage donnée :
var $range : Object
var $attr : Collection
$range:=VP Column("ViewProArea";1;2)
$attr:=VP Get row attributes($range)
Voir également
VP Get column attributes
VP SET COLUMN ATTRIBUTES
VP SET ROW ATTRIBUTES
VP Get row count
VP Get row count ( vpAreaName : Text {; sheet : Integer } ) : Integer
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Integer | <- | Total number of rows |
Description
The VP Get row count
command returns the total number of rows from the designated sheet.
In vpAreaName, pass the name property of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can define where to get the row count in the optional sheet parameter using the sheet index (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Le code suivant retourne le nombre de lignes dans la zone 4D View Pro :
var $rowCount : Integer
$rowCount:=VP Get row count("ViewProarea")
Voir également
VP Get column count
VP SET COLUMN COUNT
VP SET ROW COUNT
VP Get selection
VP Get selection ( vpAreaName : Text {; sheet : Integer } ) ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Objet plage de toutes les cellules |
Description
The VP Get selection
command returns a new range object referencing the current selected cells.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Exemple
Le code suivant récupèrera les coordonnées de la cellule active :
$currentSelection:=VP Get selection("myVPArea")
//returns a range object containing:
//$currentSelection.ranges[0].column=5
//$currentSelection.ranges[0].columnCount=2
//$currentSelection.ranges[0].row=8
//$currentSelection.ranges[0].rowCount=6
Voir également
VP ADD SELECTION
VP Get active cell
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP Get sheet count
VP Get sheet count ( vpAreaName : Text ) : Integer
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
Résultat | Integer | <- | Number of sheets |
Description
The VP Get sheet count
command returns the number of sheets in the document loaded in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
Exemple
Dans le document suivant :
Pour obtenir le nombre de feuilles et définir la feuille courante comme étant la dernière feuille :
$count:=VP Get sheet count("ViewProArea")
//set the current sheet to the last sheet (indexing starts at 0)
VP SET CURRENT SHEET("ViewProArea";$count-1)
Voir également
VP Get sheet index
VP SET SHEET COUNT
VP Get sheet index
VP Get sheet index ( vpAreaName : Text ; name : Text ) : Integer
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
name | Text | -> | Nom de la feuille | |
Résultat | Integer | <- | Numéro d'indice de la feuille |
Description
The VP Get sheet index
command returns the index of a sheet based on its name in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In name, pass the name of the sheet whose index will be returned. If no sheet named name is found in the document, the method returns -1.
La numérotation démarre à 0.
Exemple
Dans le document suivant :
Lire l'index de la feuille appelée "Total premier trimester" :
$index:=VP Get sheet index("ViewProArea";"Total premier trimestre") //retourne 2
Voir également
VP Get sheet count
VP Get sheet name
VP Get sheet name
VP Get sheet name ( vpAreaName : Text ; sheet : Integer ) : Text
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille | |
Résultat | Text | <- | Nom de la feuille |
Description
The VP Get sheet name
command returns the name of a sheet based on its index in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, pass the index of the sheet whose name will be returned.
Si l'index passé n'existe pas, la méthode retourne un nom vide.
La numérotation démarre à 0.
Exemple
Lire le nom de la troisième feuille du document :
$sheetName:=VP Get sheet name("ViewProArea";2)
Voir également
VP Get sheet options
VP Get sheet options ( vpAreaName : Text {; sheet : Integer } ) ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Sheet options object |
Description
The VP Get sheet options
command returns an object containing the current sheet options of the vpAreaName area.
Pass the name of the 4D View Pro area in vpAreaName. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet (counting begins at 0). If omitted or if you pass vk current sheet
, the current spreadsheet is used.
Objet retourné
La commande retourne un objet contenant les valeurs courantes pour toutes les options de feuille disponibles. An option value may have been modified by the user or by the VP SET SHEET OPTIONS method.
To view the full list of the options, see Sheet Options.
Exemple
$options:=VP Get sheet options("ViewProArea")
If($options.colHeaderVisible) //les en-têtes des colonnes sont visibles
... //faire quelque chose
End if
Voir également
4D VIEW PRO SHEET OPTIONS
VP SET SHEET OPTIONS
VP Get show print lines
VP Get show print lines ( vpAreaName : Text {; sheet : Integer } ) : Boolean
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | <- | Numéro d'indice de la feuille | |
Résultat | Boolean | <- | True if print lines are visible, False otherwise |
Description
The VP Get show print lines
command returns True
if the print preview lines are visible and False
if they are hidden.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, pass the index of the target sheet. If sheet is omitted, the command applies to the current sheet.
La numérotation démarre à 0.
Exemple
Le code suivant permet de vérifier si les lignes d'aperçu sont visibles ou masquées dans le document :
var $result : Boolean
$result:=VP Get show print lines("ViewProArea";1)
Voir également
VP Get spans
VP Get spans ( rangeObj : Object ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Object | <- | Object of cell spans in the defined range |
Description
The VP Get spans
command retrieves the cell spans in the designated rangeObj.
In rangeObj, pass a range of cell spans you want to retrieve. If rangeObj does not contain a cell span, an empty range is returned.
Exemple
Pour centrer le texte des cellules fusionnées dans ce document :
// Search for all cell spans
$range:=VP Get spans(VP All("ViewProArea"))
//center text
$style:=New object("vAlign";vk vertical align center;"hAlign";vk horizontal align center)
VP SET CELL STYLE($range;$style)
Voir également
VP Get stylesheet
VP Get stylesheet ( vpAreaName : Text ; styleName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
styleName | Text | -> | Nom du style | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Style sheet object |
Description
The VP Get stylesheet
command returns the styleName style sheet object containing the property values which have been defined.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In styleName, pass the name of the style sheet to get.
You can define where to get the style sheet in the optional sheet parameter using the sheet index (counting begins at 0) or with the following constants:
vk current sheet
vk workbook
Exemple
Le code suivant :
$style:=VP Get stylesheet("ViewProArea";"GreenDashDotStyle")
... will return the GreenDashDotStyle style object from the current sheet:
{
backColor:green,
borderBottom:{color:green,style:10},
borderLeft:{color:green,style:10},
borderRight:{color:green,style:10},
borderTop:{color:green,style:10}
}
Voir également
4D View Pro Style Objects and Style Sheets
VP ADD STYLESHEET
VP Get stylesheets
VP REMOVE STYLESHEET
VP Get stylesheets
VP Get stylesheets ( vpAreaName : Text { ; sheet : Integer } ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Cible (par défaut = feuille courante) | |
Résultat | Collection | <- | Collection of style sheet objects |
Description
The VP Get stylesheets
command returns the collection of defined style sheet objects from the designated sheet.
In vpAreaName, pass the name property of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can define where to get the style sheets in the optional sheet parameter using the sheet index (counting begins at 0) or with the following constants:
vk current sheet
vk workbook
Exemple
Le code suivant retournera une collection de tous les objets style de la feuille courante :
$styles:=VP Get stylesheets("ViewProArea")
Dans ce cas, la feuille courante utilise deux objets style :
[
{
backColor:green,
borderLeft:{color:green,style:10},
borderTop:{color:green,style:10},
borderRight:{color:green,style:10},
borderBottom:{color:green,style:10},
name:GreenDashDotStyle
},
{
backColor:red,
textIndent:10,
name:RedIndent
}
]
Voir également
VP ADD STYLESHEET
VP Get stylesheet
VP REMOVE STYLESHEET
VP Get table column attributes
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP Get table column attributes ( vpAreaName : Text ; tableName : Text ; column : Integer {; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
column | Integer | -> | Numéro de colonne de la table | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Attributes of the column |
Description
The VP Get table column attributes
command returns the current attributes of the specified column in the tableName.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié ou si vous passez -1, la commande s'applique à la feuille courante.
La numérotation démarre à 0.
The command returns an object describing the current attributes of the column:
Propriété | Type | Description |
---|---|---|
dataField | text | Nom de la propriété de la colonne de la table dans le contexte de données. Not returned if the table is displayed automatically |
name | text | Nom de la colonne de la table. |
footerText | text | Valeur du pied de colonne. |
footerFormula | text | Formule de pied de colonne. |
filterButtonVisible | boolean | True if the table column's filter button is displayed, False otherwise. |
If tableName is not found or if column index is higher than the number of columns, the command returns null.
Exemple
var $attributes : Object
$attributes:=VP Get table column attributes("ViewProArea"; $tableName; 1)
If ($attributes.dataField#"")
...
End if
Voir également
VP CREATE TABLE
VP Find table
VP SET TABLE COLUMN ATTRIBUTES
VP RESIZE TABLE
VP Get table column index
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP Get table column index ( vpAreaName : Text ; tableName : Text ; columnName : Text {; sheet : Integer } ) : Integer
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
columnName | Text | -> | Nom de la colonne de la table | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Integer | <- | Index of columnName |
Description
The VP Get table column index
command returns the index of the columnName in the tableName.
In vpAreaName, pass the name of the 4D View Pro area.
In columnName, pass the name of the table column for which you want to get the index.
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié ou si vous passez -1, la commande s'applique à la feuille courante.
La numérotation démarre à 0.
If tableName or columnName is not found, the command returns -1.
Exemple
// Search the column id according the column name
var $id : Integer
$id:=VP Get table column index($area; $tableName; "Weight price")
// Remove the column by id
VP REMOVE TABLE COLUMNS($area; $tableName; $id)
Voir également
VP CREATE TABLE
VP Find table
VP Get table column attributes
VP SET TABLE COLUMN ATTRIBUTES
VP Get table dirty rows
Historique
Version | Modifications |
---|---|
v19 R8 | Ajout |
VP Get table dirty rows ( vpAreaName : Text ; tableName : Text { ; reset : Boolean {; sheet : Integer }} ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
reset | Boolean | -> | True to clear the dirty status from the current table, False to keep it untouched. Default=True | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Collection | <- | Collection of objects with all the items modified since the last reset |
Description
The VP Get table dirty rows
command returns a collection of dirty row objects, containing items that were modified since the last reset in the specified tableName.
In vpAreaName, pass the name of the 4D View Pro area.
In tableName, pass the name of the table for which you want to get the dirty rows. Only modified columns bound to a data context will be taken into account.
By default, calling the command will clear the dirty status from the current table. To keep this status untouched, pass False
in the reset parameter.
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié ou si vous passez -1, la commande s'applique à la feuille courante.
La numérotation démarre à 0.
Each dirty row object in the returned collection contains the following properties:
Propriété | Type | Description |
---|---|---|
item | object | Objet modifié de la ligne modifiée |
originalItem | object | Objet avant modification |
row | entier | Index de la ligne modifiée |
If tableName is not found or if it does not contain a modified column, the command returns an empty collection.
Exemple
Vous souhaitez compter le nombre de lignes éditées :
var $dirty : Collection
$dirty:=VP Get table dirty rows("ViewProArea"; "ContextTable"; False)
VP SET NUM VALUE(VP Cell("ViewProArea"; 0; 0); $dirty.length)
Voir également
VP CREATE TABLE
VP Find table
VP SET TABLE COLUMN ATTRIBUTES
VP RESIZE TABLE
VP Get table range
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP Get table range ( vpAreaName : Text ; tableName : Text {; onlyData : Integer {; sheet : Integer }} ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
onlyData | Integer | -> | vk table full range (default) or vk table data range | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Object | <- | Range that contains the table |
Description
The VP Get table range
command returns the range of tableName.
In vpAreaName, pass the name of the 4D View Pro area.
In the onlyData parameter, you can pass one of the following constants to indicate if you want to get the data only:
Constante | Valeur | Description |
---|---|---|
vk table full range | 0 | Get the cell range for the table area with footer and header (default if omitted) |
vk table data range | 1 | Get the cell range for the table data area only |
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié, la commande s'applique à la feuille en cours.
La numérotation démarre à 0.
If tableName is not found, the command returns null.
Voir également
VP Get table theme
Historique
Version | Modifications |
---|---|
v19 R8 | Ajout |
VP Get table theme ( vpAreaName : Text ; tableName : Text ) : cs.ViewPro.TableTheme
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
Résultat | cs.ViewPro.TableTheme | <- | Current table theme property values |
Description
The VP Get table theme
command returns the current theme propertie values of the tableName. A table theme can be set using the VP CREATE TABLE
or VP SET TABLE THEME
commands, or through the interface.
In vpAreaName, pass the name of the 4D View Pro area and in tableName, the name of the table.
The command returns an object of the cs.ViewPro.TableTheme class with properties and values that describe the current table theme.
Exemple
The command returns a full theme
object even if a native SpreadJS theme name was used to define the theme.
var $param : cs.ViewPro.TableTheme
$param:=cs.ViewPro.TableTheme.new()
$param.theme:="dark10" //utilisation d'un nom de thème natif
VP SET TABLE THEME("ViewProArea"; "ContextTable"; $param)
$vTheme:=VP Get table theme("ViewProArea"; "ContextTable")
$result:=Asserted(Value type($vTheme.theme)=Is object) //vrai
Voir également
VP CREATE TABLE
VP SET TABLE THEME
VP Get tables
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP Get tables ( vpAreaName : Text { ; sheet : Integer } ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) | |
Résultat | Collection | <- | Text collection with all table names |
Description
The VP Get tables
command returns a collection of all table names defined in the sheet.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié, la commande s'applique à la feuille en cours.
La numérotation démarre à 0.
Exemple
Le code suivant retournera une collection de tous les noms de tables de la feuille courante :
$tables:=VP Get tables("ViewProArea")
//$tables contains for example ["contextTable","emailTable"]
Voir également
VP Get value
VP Get value ( rangeObj : Object ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Object | <- | Object containing a cell value |
Description
The VP Get value
command retrieves a cell value from a designated cell range.
In rangeObj, pass a range whose value you want to retrieve.
Objet retourné
The object returned will contain the value
property, and, in case of a js date value, a time
property:
Propriété | Type | Description |
---|---|---|
value | Entier long, Réel, Booléen, Texte, Date | Value in the rangeObj (except- time) |
time | Real | Valeur heure (en secondes) si la valeur est du type js |
Si l'objet retourné inclut une date ou une heure, il est traité en tant que datetime et est complété comme suit :
- valeur heure - la date est complétée comme suit : December 30, 1899 au format dd/MM/yyyy (30/12/1899)
- valeur date - l'heure est complétée comme suit : minuit au format HH:mm:ss (00:00:00)
If rangeObj contains multiple cells or multiple ranges, the value of the first cell is returned. La commande retourne un objet null si la cellule est vide.
Exemple
$cell:=VP Cell("ViewProArea";5;2)
$value:=VP Get value($cell)
If(Value type($value.value)=Is text)
VP SET VALUE($cell;New object("value";Uppercase($value.value)))
End if
Voir également
VP Get values
VP SET VALUE
VP SET VALUES
VP Get values
VP Get values ( rangeObj : Object ) : Collection
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
Résultat | Collection | <- | Collection of values |
Description
The VP Get values
command retrieves the values from the designated rangeObj.
In rangeObj, pass a range whose values you want to retrieve. If rangeObj includes multiple ranges, only the first range is used.
The collection returned by VP Get values
contains a two-dimensional collection:
- Chaque élément de la collection de premier niveau représente une ligne et contient une sous-collection de valeurs
- Chaque sous-collection contient des valeurs des cellule de la ligne. Les valeurs peuvent être de type entier, réel, booléen, texte, null. Si une valeur est de type date ou heure, elle est retournée en un objet dont les propriétés sont les suivantes :
Propriété | Type | Description |
---|---|---|
value | Date | Valeur dans la cellule (sauf heure) |
time | Real | Valeur heure (en secondes) si la valeur est du type js |
Les dates ou les heures sont considérées comme un datetime et sont complétées comme suit :
- valeur de type heure - la partie date est complétée comme étant le 30 décembre 1899
- valeur de type date - la partie heure est complétée comme étant minuit (00:00:00:000)
Exemple
Vous souhaitez lire les valeurs allant de C4 à G6 :
$result:=VP Get values(VP Cells("ViewProArea";2;3;5;3))
// $result[0]=[4,5,null,hello,world]
// $result[1]=[6,7,8,9,null]
// $result[2]=[null,{time:42,value:2019-05-29T00:00:00.000Z},null,null,null]
Voir également
VP Get formulas
VP Get value
VP SET FORMULAS
VP SET VALUES
VP Get workbook options
VP Get workbook options ( vpAreaName : Text ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
Résultat | Object | <- | Objet contenant les options de workbook |
Description
VP Get workbook options
returns an object containing all the workbook options in vpAreaName
In vpAreaName, pass the name of the 4D View Pro area.
The returned object contains all the workbook options (default and modified ones), in the workbook.
The list of workbook options is referenced in VP SET WORKBOOK OPTIONS
's description.
Exemple
var $workbookOptions : Object
$workbookOptions:=VP Get workbook options("ViewProArea")
Voir également
I
VP IMPORT DOCUMENT
Historique
Version | Modifications |
---|---|
v20 R2 | Support of .sjs documents |
VP IMPORT DOCUMENT ( vpAreaName : Text ; filePath : Text { ; paramObj : Object} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
filePath | Text | -> | Chemin d'accès du document | |
paramObj | Object | -> | Options d'import |
Description
The VP IMPORT DOCUMENT
command imports and displays the document designated by filePath in the 4D View Pro area vpAreaName. Le document importé remplace toutes les données déjà présentes dans la zone.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In filePath, pass the path and name of the document to be imported. Les formats suivants sont pris en charge :
- Les documents 4D View Pro (extension ".4vp")
- Microsoft Excel (extension ".xlsx")
- documents texte (extension ".txt", ".csv", le document doit être en utf-8)
- SpreadJS documents (extension ".sjs")
If the document extension is not a recognized extension, such as .4vp
or .xlsx
, the document is considered a text document. Vous devez passer un chemin d'accès complet, sauf si le document est situé au même niveau que le dossier Project, auquel cas vous pouvez simplement passer son nom.
An error is returned if the filePath
parameter is invalid, or if the file is missing or malformed.
The optional paramObj parameter allows you to define properties for the imported document:
Paramètres | Type | Description | |
---|---|---|---|
formula | 4D.Function | Une méthode callback à lancer lorsque l'import est terminé. You must use a formula returned by the Formula command. See Passing a callback method (formula). | |
password | text | Microsoft Excel uniquement (optionnel) - Mot de passe utilisé pour protéger un document Microsoft Excel. | |
csvOptions | object | options d'import csv | |
range | object | Plage de cellules contenant la première cellule dans laquelle les données seront saisies. Si la plage spécifiée n'est pas une plage de cellules, seule la première cellule de la plage est utilisée. | |
rowDelimiter | text | Délimiteur de ligne. S'il n'est pas défini, le délimiteur est automatiquement déterminé par 4D. | |
columnDelimiter | text | Délimiteur de colonne. Par défaut : "," | |
sjsOptions | object | options d'import sjs | |
calcOnDemand | boolean | Indique si les formules doivent être calculées uniquement lorsqu'elles sont demandées, la valeur par défaut est faux. | |
dynamicReferences | boolean | Indique si les fonctions doivent être calculées avec des références dynamiques, la valeur par défaut est vrai. | |
fullRecalc | boolean | Indique si le calcul doit être effectué après le chargement des données json, la valeur par défaut est faux. | |
includeFormulas | boolean | Whether to include the formulas when loading, default is true. | |
includeStyles | boolean | Whether to include the styles when loading, default is true. | |
includeUnusedStyles | boolean | Whether to include the unused name styles when converting excel xml to the json, default is true. | |
openMode | entier |
- Importing files in .xslx, .csv, and .sjs formats is asynchronous. With these formats, you must use the
formula
attribute if you want to start an action at the end of the document processing. - When importing a Microsoft Excel-formatted file into a 4D View Pro document, some settings may be lost. You can verify your settings with this list from SpreadJS.
- For more information on the CSV format and delimiter-separated values in general, see this article on Wikipedia
Exemple 1
Vous souhaitez importer un document 4D View Pro stocké sur le disque, à l'ouverture du formulaire :
C_TEXT($docPath)
If(Form event code=On VP Ready) //La zone 4D View Pro est chargée et prête
$docPath:="C:\\Bases\\ViewProDocs\\MyExport.4VP"
VP IMPORT DOCUMENT("VPArea";$docPath)
End if
Exemple 2
Vous souhaitez importer un document Microsoft Excel protégé par un mot de passe dans 4D View Pro :
//Import code
var $o : Object
$o:=New object
$o.password:="excel123"
$o.formula:=Formula(myImport)
VP IMPORT DOCUMENT("ViewProArea";"c:\\tmp\\excelfilefile.xlsx";$o)
//myImport callback method
#DECLARE($area : Text; $filePath : Text; $param : Object; $status : Object)
If ($status.success)
ALERT("Import successfully completed")
Else
ALERT("Error: "+$status.errorMessage)
End if
Exemple 3
You want to import a .txt
file that uses a comma (",") as delimiter:
$params:=New object
$params.range:=VP Cells("ViewProArea";0;0;2;5)
VP IMPORT DOCUMENT("ViewProArea";"c:\\import\\my-file.txt";New object("csvOptions";$params))
Here's the result:
Voir également
VP EXPORT DOCUMENT
VP NEW DOCUMENT
VP IMPORT FROM BLOB
VP IMPORT FROM BLOB ( vpAreaName : Text ; vpBlob : 4D.blob { ; paramObj : Object} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
vpBlob | 4D.Blob | -> | Blob contenant un document 4D View Pro | |
paramObj | Object | -> | Options d'import |
Description
The VP IMPORT FROM BLOB
command imports the vpBlob in the 4D View Pro area vpAreaName and replaces its contents. vpBlob must contain a 4D View Pro document previously saved as Blob either by using the VP EXPORT TO BLOB command or via the 4D View Pro interface.
In paramObj, you can pass several properties:
Propriété | Type | Description |
---|---|---|
formula | 4D.Function | Callback method to be launched when the import has completed. See Passing a callback method (formula). |
calcOnDemand | Boolean | Whether to calculate formulas only when they are demanded, default=false. |
dynamicReferences | Boolean | Whether to calculate functions with dynamic reference, default=true. |
fullRecalc | Boolean | Indique si le calcul doit être effectué après le chargement des données json, la valeur par défaut est faux. |
includeFormulas | Boolean | Whether to include the formula when loading, default=true. |
includeStyles | Boolean | Whether to include the style when loading, default=true. |
includeUnusedStyles | Boolean | Whether to include the unused name style when converting excel xml to the json, default=true. |
openMode | Integer | can be: 0: normal open mode, without lazy and incremental. When opening document, UI and UI event could be refreshed and responsive at specific time points. 1: lazy open mode. When opening document, only the active sheet will be loaded directly. Other sheets will be loaded only when they are be used. 2: incremental open mode. When opening document, UI and UI event could be refreshed and responsive directly. |
Les paramètres suivants peuvent être utilisés dans la méthode de rappel :
Paramètres | Type | Description | |
---|---|---|---|
param1 | text | The name of the 4D View Pro area object | |
param2 | 4D.Blob | Le blob importé | |
param3 | object | A reference to the command's paramObj parameter | |
param4 | object | Objet retourné par la méthode avec un message de statut | |
.success | boolean | Vrai si l'import est réussi, Faux sinon. | |
.errorCode | entier | Code d'erreur. | |
.errorMessage | text | Message d'erreur. |
Exemple
Vous souhaitez importer dans la "ViewProArea" un document 4D View Pro précédemment enregistré en tant que Blob dans la première entité de la dataclass Table.
var $myBlobDocument : 4D.Blob :=ds.Table.all().first().blob
VP IMPORT FROM BLOB("ViewProArea"; $myBlobDocument)
Voir également
VP IMPORT FROM OBJECT
VP IMPORT FROM OBJECT ( vpAreaName : Text { ; viewPro : Object} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
viewPro | Object | -> | Objet 4D View Pro |
Description
The VP IMPORT FROM OBJECT
command imports and displays the viewPro 4D View Pro object in the vpAreaName 4D View Pro area. Le contenu de l'objet importé remplace toutes les données insérées auparavant dans la zone.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In viewPro, pass a valid 4D View Pro object. This object can have been created using VP Export to object or manually. For more information on 4D View Pro objects, please refer to the 4D View Pro object section.
An error is returned if the viewPro object is invalid.
Exemple
Vous souhaitez importer une feuille de calcul précédemment stockée dans un champ objet :
QUERY([VPWorkBooks];[VPWorkBooks]ID=10)
VP IMPORT FROM OBJECT("ViewProArea1";[VPWorkBooks]SPBook)
Voir également
VP INSERT COLUMNS
VP INSERT COLUMNS ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP INSERT COLUMNS
command inserts columns into the rangeObj.
In rangeObj, pass an object containing a range of the starting column (the column which designates where the new column will be inserted) and the number of columns to insert. Si le nombre de colonnes à insérer est omis (non défini), une seule colonne est insérée.
New columns are inserted on the left, directly before the starting column in the rangeObj.
Exemple
Pour insérer 3 colonnes avant la deuxième colonne :
VP INSERT COLUMNS(VP Column("ViewProArea";1;3))
Le résultat est le suivant :
Voir également
VP DELETE COLUMNS
VP DELETE ROWS
VP INSERT ROWS
VP INSERT ROWS
VP INSERT ROWS ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP INSERT ROWS
command inserts rows defined by the rangeObj.
In rangeObj, pass an object containing a range of the starting row (the row which designates where the new row will be inserted) and the number of rows to insert. Si le nombre de lignes à insérer est omis (non défini), une seule ligne est insérée.
New rows are inserted directly before the first row in the rangeObj.
Exemple
Pour insérer 3 lignes avant la première ligne :
VP INSERT ROWS(VP Row("ViewProArea";0;3))
Le résultat est le suivant :
Voir également
VP DELETE COLUMNS
VP DELETE ROWS
VP INSERT COLUMNS
VP INSERT TABLE COLUMNS
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP INSERT TABLE COLUMNS ( vpAreaName : Text ; tableName : Text ; column : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
column | Integer | -> | Index dans la table de la colonne de départ à insérer | |
count | Text | -> | Number of columns to add (must be >0) | |
insertAfter | Integer | -> | vk table insert before or vk table insert after column | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP INSERT TABLE COLUMNS
command inserts one or count empty column(s) in the specified tableName at the specified column index.
When a column has been inserted with this command, you typically modify its contents using the VP SET TABLE COLUMN ATTRIBUTES command.
In the insertAfter parameter, you can pass one of the following constants to indicate if the column(s) must be inserted before or after the column index:
Constante | Valeur | Description |
---|---|---|
vk table insert before | 0 | Insert column(s) before the column (default if omitted) |
vk table insert after | 1 | Insert column(s) after the column |
This command inserts some columns in the tableName table, NOT in the sheet. The total number of columns of the sheet is not impacted by the command. Data present at the right of the table (if any) are automatically moved right according to the number of added columns.
If tableName does not exist or if there is not enough space in the sheet, nothing happens.
Exemple
See examples for VP INSERT TABLE ROWS and VP SET TABLE COLUMN ATTRIBUTES.
Voir également
VP INSERT TABLE ROWS
VP REMOVE TABLE COLUMNS
VP SET TABLE COLUMN ATTRIBUTES
VP INSERT TABLE ROWS
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP INSERT TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
row | Integer | -> | Index in the table of the starting row to insert | |
count | Text | -> | Number of rows to add (must be >0) | |
insertAfter | Integer | -> | vk table insert before or vk table insert after row | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP INSERT TABLE ROWS
command inserts one or count empty row(s) in the specified tableName at the specified row index.
In the insertAfter parameter, you can pass one of the following constants to indicate if the row(s) must be inserted before or after the row index:
Constante | Valeur | Description |
---|---|---|
vk table insert before | 0 | Insert row(s) before the row (default if omitted) |
vk table insert after | 1 | Insert row(s) after the row |
This command inserts some rows in the tableName table, NOT in the sheet. The total number of rows of the sheet is not impacted by the command. Data present below the table (if any) are automatically moved down according to the number of added rows.
If the tableName table is bound to a data context, the command inserts new, empty element(s) in the collection.
If tableName does not exist or if there is not enough space in the sheet, nothing happens.
Exemple
Vous créez une table avec un contexte de données :
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 insert two rows and two columns in the table, you can write:
VP INSERT TABLE ROWS("ViewProArea"; "PeopleTable"; 1; 2)
VP INSERT TABLE COLUMNS("ViewProArea"; "PeopleTable"; 1; 2)
Voir également
VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS
M
VP MOVE CELLS
Historique
Version | Modifications |
---|---|
v19 R4 | Ajout |
VP MOVE CELLS ( originRange : Object ; targetRange : Object ; options : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
originRange | Object | -> | Cell range to copy from | |
targetRange | Object | -> | Target range for the values, formatting and formulas | |
options | Object | -> | Options supplémentaires |
Description
The VP MOVE CELLS
command moves or copies the values, style and formulas from originRange to targetRange.
originRange and targetRange can refer to different View Pro areas.
In originRange, pass a range object containing the values, style, and formula cells to copy or move. If originRange is a combined range, only the first one is used.
In targetRange, pass the range of cells where the cell values, style, and formulas will be copied or moved.
The options parameter has several properties:
Propriété | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
copy | Boolean | Determines if the values, formatting and formulas of the cells in originRange are removed after the command executes:
| ||||||||||||||
pasteOptions | Longint | Specifies what is pasted. Possible values:
|
The paste options defined in the workbook options are taken into account.
Exemple
Pour copier le contenu, les valeurs, le formatage et les formules d'une plage d'origine :
var $originRange; $targetRange; $options : Object
$originRange:=VP Cells("ViewProArea"; 0; 0; 2; 5)
$targetRange:=VP Cells("ViewProArea"; 4; 0; 2; 5)
$options:=New object
$options.copy:=True
$options.pasteOptions:=vk clipboard options all
VP MOVE CELLS($originRange; $targetRange; $options)
Voir également
VP Copy to object
VP PASTE FROM OBJECT
VP SET WORKBOOK OPTIONS
N
VP Name
VP Name ( vpAreaName : Text ; rangeName : Text { ; sheet : Integer } ) : Object
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
rangeName | Text | -> | Nom de plage existante | |
sheet | Integer | -> | Emplacement de la plage (si omis, feuille courante) | |
Résultat | Object | <- | Range object of name |
Description
The VP Name
command returns a new range object referencing a named range.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The rangeName parameter specifies an existing named cell range.
In the optional sheet parameter, you can designate a specific spreadsheet where rangeName is defined. Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante ou l'intégralité du classeur (workbook) à l'aide des constantes suivantes :
vk current sheet
vk workbook
Exemple
Vous souhaitez assigner une valeur à une plage nommée "Total".
// nommez la cellule B5 Total
VP ADD RANGE NAME(VP Cell("ViewProArea";1;4);"Total")
$name:=VP Name("ViewProArea";" Total")
VP SET NUM VALUE($name;285;"$#,###.00")
Voir également
VP ADD RANGE NAME
VP ALL
VP Cell
VP Cells
VP Column
VP Combine ranges
VP Get names
VP REMOVE NAME
VP Row
VP NEW DOCUMENT
VP NEW DOCUMENT ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
Description
The VP NEW DOCUMENT
command loads and display a new, default document in the 4D View Pro form area object vpAreaName. Le nouveau document vide remplace toutes les données auparavant insérées dans la zone.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Exemple
Vous souhaitez afficher un document vide dans l'objet formulaire "myVPArea" :
VP NEW DOCUMENT("myVPArea")
Voir également
O
VP Object to font
VP Object to font ( fontObj : Object ) : Text
Paramètres | Type | Description | ||
---|---|---|---|---|
fontObj | Object | -> | Objet police | |
Résultat | Text | <- | Font shorthand |
Description
The VP Object to font
command returns a font shorthand string from fontObj.
In fontObj, pass an object containing the font properties. Les propriétés suivantes sont prises en charge :
Propriété | Type | Description | Valeurs possibles | Obligatoire |
---|---|---|---|---|
family | text | Définit la police. | tout type de famille de police standard ou générique. Ex : Ex : Ex : "Arial", "Helvetica", "serif", "arial,sans-serif" | Oui |
size | text | Définit la taille de la police. Le line-height peut être ajouté au font-size : font-size/line-height : Ex : "15pt/20pt" | a number with one of the following units: vk font size large vk font size larger vk font size x large vk font size xx large vk font size small vk font size smaller vk font size x small vk font size xx small | Oui |
style | text | Style de police. | vk font style italic vk font style oblique | Non |
variant | text | Police en petites majuscules. | vk font variant small caps | Non |
weight | text | Définit l'épaisseur de la police. | vk font weight 100 vk font weight 200 vk font weight 300 vk font weight 400 vk font weight 500 vk font weight 600 vk font weight 700 vk font weight 800 vk font weight 900 vk font weight bold vk font weight bolder vk font weight lighter | Non |
This object can be created with the VP Font to object command.
The returned shorthand string can be assigned to the "font" property of a cell with the VP SET CELL STYLE, for example.
Exemple
$cellStyle:=VP Get cell style($range)
$font:=VP Font to object($cellStyle.font)
$font.style:=vk font style oblique
$font.variant:=vk font variant small caps
$font.weight:=vk font weight bolder
$cellStyle.font:=VP Object to font($font)
//$cellStyle.font contains "bolder oblique small-caps 16pt arial"
Voir également
4D View Pro Style Objects and Style Sheets
VP Font to object
VP SET CELL STYLE
VP SET DEFAULT STYLE
P
VP PASTE FROM OBJECT
Historique
Version | Modifications |
---|---|
v19 R4 | Ajout |
VP PASTE FROM OBJECT ( rangeObj : Object ; dataObject : Object {; options : Longint} )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage de cellules | |
dataObject | Object | -> | Object containing the data to be pasted | |
options | Longint | -> | Specifies what is pasted |
Description
The VP PASTE FROM OBJECT
command pastes the contents, style and formulas stored in dataObject to the rangeObj object.
In rangeObj, pass the cell range object where the values, formatting, and/or formula cells will be pasted. If rangeObj refers to more than one cell, only the first one is used.
In dataObject, pass the object that contains the cell data, formatting, and formulas to be pasted.
In the optional options parameter, you can specify what to paste in the cell range. Valeurs possibles :
|Constant|Description|
|---|---|---|
|vk clipboard options all
|Pastes all data objects, including values, formatting, and formulas.|
|vk clipboard options formatting
|Pastes only the formatting.|
|vk clipboard options formulas
|Pastes only the formulas.|
|vk clipboard options formulas and formatting
|Pastes formulas and formatting.|
|vk clipboard options values
|Pastes only values.|
|vk clipboard options value and formatting
|Pastes values and formatting.|
The paste options defined in the workbook options are taken into account.
If options refers to a paste option not present in the copied object (e.g. formulas), the command does nothing.
Exemple
See example the example from VP Copy to object
Voir également
VP Copy to object
VP MOVE CELLS
VP Get workbook options
VP SET WORKBOOK OPTIONS
VP PRINT
VP PRINT ( vpAreaName : Text { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP PRINT
command opens a print dialog window to print vpAreaName.
Pass the 4D View Pro area to be printed in vpAreaName. La commande ouvrira la fenêtre de dialogue d'impression permettant de définir l'imprimante et les propriétés de la page.
The properties defined in the print dialog window are for the printer paper, they are not the printing properties for the 4D View Pro area. Printing properties for 4D View Pro areas are defined using the VP SET PRINT INFO command. It is highly recommended that the properties for both the printer and the 4D View Pro area match, otherwise the printed document may not correspond to your expectations.
In the optional sheet parameter, you can designate a specific spreadsheet to print (counting begins at 0). S'il est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante ou le workbook entier à l'aide des constantes suivantes :
vk current sheet
vk workbook
- 4D View Pro areas can only be printed with the
VP PRINT
command.- Commands from the 4D Printing language theme are not supported by
VP PRINT
.- This command is intended for individual printing by the final end user. For automated print jobs, it is advised to export the 4D View Pro area as a PDF with the VP EXPORT DOCUMENT method.
Exemple
Le code suivant :
VP PRINT("myVPArea")
... will open a print dialog window:
Voir également
VP EXPORT DOCUMENT
VP SET PRINT INFO
R
VP RECOMPUTE FORMULAS
VP RECOMPUTE FORMULAS ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
Description
The VP RECOMPUTE FORMULAS
command immediately evaluates all formulas in vpAreaName. Par défaut, 4D calcule automatiquement les formules lorsqu'elles sont insérées, importées ou exportées. VP RECOMPUTE FORMULAS
allows you to force the compute at any time (e.g, in case modifications are made to the formulas or if the formulas contain calls to the database). The command launches the execution of the VP FLUSH COMMANDS command to execute any stored commands and clear the command buffer, then calculates all formulas in the workbook.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Be sure the VP SUSPEND COMPUTING command has not been executed before using
VP RECOMPUTE FORMULAS
, otherwise the command does nothing.
Exemple
Pour actualiser toutes les forumules du workbook, saisissez le code suivant :
VP RECOMPUTE FORMULAS("ViewProArea")
Voir également
VP RESUME COMPUTING
VP SUSPEND COMPUTING
VP REMOVE NAME
VP REMOVE NAME ( vpAreaName : Text ; name : Text { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
name | Text | -> | Nom de la plage nommée ou de la formule nommée à supprimer | |
scope | Integer | -> | "Scope" cible (par défaut=feuille courante) |
Description
The VP REMOVE NAME
command removes the named range or named formula passed in the name parameter in the defined scope.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the named range or named formula that you want to remove in name.
You can define where to remove the name in scope using either the sheet index (counting begins at 0) or the following constants:
vk current sheet
vk workbook
Exemple
$range:=VP Cell("ViewProArea";0;0)
VP ADD RANGE NAME("Total1";$range)
VP REMOVE NAME("ViewProArea";"Total1")
$formula:=VP Get formula by name("ViewProArea";"Total1")
//$formula=null
Voir également
VP REMOVE SHEET
VP REMOVE SHEET ( vpAreaName : Text ; index: Integer )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
index | Integer | -> | Index of the sheet to remove |
Voir également
Description
The VP REMOVE SHEET
command removes the sheet with the specified index from the document loaded in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In index, pass the index of the sheet to remove. If the passed index does not exist, the command does nothing.
La numérotation démarre à 0.
Exemple
Le document comporte actuellement 3 feuilles :
Supprimer la troisième feuille :
VP REMOVE SHEET("ViewProArea";2)
VP REMOVE SPAN
VP REMOVE SPAN ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP REMOVE SPAN
command removes the span from the cells in rangeObj.
In rangeObj, pass a range object of the cell span. Les cellules fusionnées de la plage sont divisées en cellules individuelles.
Exemple
Pour retirer toutes les fusions de cellules de ce document :
//find all cell spans
$span:=VP Get spans(VP All("ViewProArea"))
//remove the cell spans
VP REMOVE SPAN($span)
Résultat:
Voir également
VP REMOVE STYLESHEET
VP REMOVE STYLESHEET ( vpAreaName : Text ; styleName : Text { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
styleName | Text | -> | Nom du style à supprimer | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP REMOVE STYLESHEET
command removes the style sheet passed in the styleName from the vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the style sheet to remove in the styleName parameter.
You can define where to remove the style in the optional sheet parameter using the sheet index (counting begins at 0) or with the following constants:
vk current sheet
vk workbook
Exemple
To remove the GreenDashDotStyle style object from the current sheet:
VP REMOVE STYLESHEET("ViewProArea";"GreenDashDotStyle")
Voir également
VP ADD STYLESHEET
VP Get stylesheet
VP Get stylesheets
VP REMOVE TABLE
Historique
Version | Modifications |
---|---|
v19 R6 | Ajout |
VP REMOVE TABLE ( vpAreaName : Object; tableName : Text {; options : Integer} {; sheet : Integer}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom de la zone 4D View Pro | |
tableName | Text | -> | Nom de la table à supprimer | |
options | Integer | -> | Options supplémentaires | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP REMOVE TABLE
command removes a table that you created with VP CREATE TABLE.
In vpAreaName, pass the name of the area where the table to remove is located.
In tableName, pass the name of the table to remove.
In options, you can specify additional behavior. Valeurs possibles :
Constante | Valeur | Description |
---|---|---|
vk table remove all | 0 | Remove all including style and data |
vk table remove style | 1 | Remove style but keep data |
vk table remove data | 2 | Remove data but keep style |
Table names are defined at sheet level. You can specify where the table is located using the optional sheet parameter (indexing starts at 0).
Exemple
To remove the "people" table in the second sheet and keep the data in the cells:
VP REMOVE TABLE("ViewProArea"; "people"; vk table remove style; 2)
Voir également
VP REMOVE TABLE COLUMNS
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP REMOVE TABLE COLUMNS ( vpAreaName : Text ; tableName : Text ; column : Integer {; count : Integer {; sheet : Integer }}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
column | Integer | -> | Index in the table of the starting column to remove | |
count | Text | -> | Number of columns to remove (must be >0) | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP REMOVE TABLE COLUMNS
command removes one or count column(s) in the specified tableName at the specified column index. The command removes values and styles.
The command removes columns from the tableName table, NOT from the sheet. The total number of columns of the sheet is not impacted by the command. The total number of columns of the sheet is not impacted by the command.
If tableName does not exist, nothing happens.
Exemple
To remove two columns from 3rd column of the "dataTable" table:
VP REMOVE TABLE COLUMNS("ViewProArea"; "dataTable"; 3; 2)
Voir également
VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS
VP REMOVE TABLE ROWS
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP REMOVE TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; sheet : Integer }}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
row | Integer | -> | Index in the table of the starting row to remove | |
count | Text | -> | Number of rows to remove (must be >0) | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP REMOVE TABLE ROWS
command removes one or count row(s) from the specified tableName at the specified row index. The command removes values and styles.
This command removes rows from the tableName table, NOT from the sheet. The total number of rows of the sheet is not impacted by the command. The total number of rows of the sheet is not impacted by the command.
If the tableName table is bound to a data context, the command removes element(s) from the collection.
If tableName does not exist, nothing happens.
Exemple
To remove two rows from 3rd row of the "dataTable" table:
VP REMOVE TABLE ROWS("ViewProArea"; "dataTable"; 3; 2)
Voir également
VP INSERT TABLE ROWS
VP REMOVE TABLE COLUMNS
VP RESET SELECTION
VP RESET SELECTION ( vpAreaName : Text { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP RESET SELECTION
command deselects all cells, resulting in no current selection or visible active cell.
Une cellule active par défaut (cellule A1) reste définie pour les commandes 4D View Pro.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
Vous souhaitez déselectionner toutes les cellules (la cellule active et toute autre cellule sélectionée) :
VP RESET SELECTION("myVPArea")
Voir également
VP ADD SELECTION
VP Get active cell
VP Get selection
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP RESIZE TABLE
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP RESIZE TABLE ( rangeObj : Object; tableName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Nouvelle plage de la table | |
tableName | Text | -> | Nom de la table |
Description
The VP RESIZE TABLE
command changes the tableName size with regards to the rangeObj.
Les règles suivantes s'appliquent :
- 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.
Exemple
Vous créez une table avec un contexte de données :
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. Vous pouvez écrire :
VP RESIZE TABLE(VP Cells("ViewProArea"; 0; 1; 4; 6); "PeopleTable")
Voir également
VP CREATE TABLE
VP Get table range
VP RESUME COMPUTING
VP RESUME COMPUTING ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
Description
The VP RESUME COMPUTING
command restarts the calculation of formulas in vpAreaName.
La commande réactive le service de calcul de 4D View Pro. Any formulas impacted by changes made while calculations were suspended are updated, and formulas added after VP RESUME COMPUTING
is executed are calculated.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Le service de calcul de 4D View Pro maintient un compteur d'actions de suspension/reprise. Therefore, each execution of
VP RESUME COMPUTING
must be balanced by a corresponding execution of the VP SUSPEND COMPUTING command.
Exemple
See example in VP SUSPEND COMPUTING.
Voir également
VP RECOMPUTE FORMULAS
VP SUSPEND COMPUTING
VP Row
VP Row ( vpAreaName : Text; row : Integer { ; rowCount : Integer { ; sheet : Integer } } ) : Object
Paramètres | Type | Description | |
---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
row | Integer | -> | Indice de la ligne |
rowCount | Integer | -> | Nombre de lignes |
|sheet |Integer|->|Sheet index (current sheet if omitted)| |Result |Object|<-|Range object of row(s)|
Description
The VP Row
command returns a new range object referencing a specific row or rows.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The row parameter defines the first row of the row range. Passez l'indice de la ligne (la numérotation commence à zéro) dans ce paramètre. If the range contains multiple rows, you should also use the optional rowCount parameter.
The optional rowCount parameter allows you to define the total number of rows of the range. rowCount must be greater than 0. Passez l'indice de la ligne (la numérotation commence à zéro) dans ce paramètre.
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
|
Vous pouvez écrire :
$row:=VP Row("ViewProArea";9) // row 10
Voir également
VP All
VP Cell
VP Cells
VP Column
VP Combine ranges
VP Name
VP ROW AUTOFIT
VP ROW AUTOFIT ( rangeObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP ROW AUTOFIT
command automatically sizes the row(s) in rangeObj according to their contents.
In rangeObj, pass a range object containing a range of the rows whose size will be automatically handled.
Exemple
Les lignes suivantes n'affichent pas correctement le texte :
VP ROW AUTOFIT(VP Row("ViewProArea";1;2))
Résultat:
Voir également
VP Run offscreen area
VP Run offscreen area ( parameters : Object) : Mixed
Paramètres | Type | Description | ||
---|---|---|---|---|
parameters | Object | -> | Objet contenant les attributs de la zone hors écran | |
Résultat | Mixed | <- | .result property of the .onEvent object, or Null if does not return a value |
Description
The VP Run offscreen area
command creates an offscreen area in memory which can be used to process 4D View Pro area commands and functions.
In parameters object, pass any of the following optional properties. These properties will be available through the This
command within the onEvent
method and reference the instance:
Propriété | Type | Description |
---|---|---|
area | text | Le nom de la zone hors écran. S'il est omis ou null, un nom générique est assigné (ex : OffscreenArea1). |
onEvent | objet (formula) | Une méthode callback qui sera lancée lorsque la zone hors écran sera prête. It can be either:onEvent function of a class, orFormula objectOn VP Ready , On Load , On Unload , On End URL Loading , On URL Loading Error , On VP Range Changed , or On Timer events. The callback method can be used to access the 4D View Pro form object variable. |
autoQuit | boolean | True (default value) if the command must stop the formula execution when the On End URL Loading or On URL Loading Error events occur. If false, you must use the CANCEL or ACCEPT commands in the onEvent callback method. |
timeout | number | Durée maximale (exprimée en secondes) avant la fermeture de la zone si aucun événement n'est généré. Si elle est fixée à 0, aucune limitation n'est appliquée. Valeur par défaut : 60 |
result | mixte | Résultat du traitement (le cas échéant) |
<customProperty> | mixte | Any custom attribute to be available in the onEvent callback method. |
La propriété suivante est automatiquement ajoutée par la commande, si nécessaire :
Propriété | Type | Description |
---|---|---|
timeoutReached | boolean | Ajouté avec la valeur vrai si le timeout a été dépassé |
The offscreen area is only available during the execution of the
VP Run offscreen area
command. Elle sera automatiquement détruite à la fin de l'exécution.
Les commandes suivantes peuvent être utilisées dans la méthode callback (de rétro-appel) :
ACCEPT
CANCEL
SET TIMER
WA Evaluate JavaScript
WA EXECUTE JAVASCRIPT FUNCTION
Exemple 1
Vous souhaitez créer une zone 4D View Pro hors écran et lire la valeur d'une cellule :
// cs.OffscreenArea class declaration
Class constructor ($path : Text)
This.filePath:=$path
// This function will be called on each event of the offscreen area
Function onEvent()
Case of
:(FORM Event.code=On VP Ready)
VP IMPORT DOCUMENT(This.area;This.filePath)
This.result:=VP Get value(VP Cell(This.area;6;22))
ALERT("The G23 cell contains the value: "+String(This.result))
End case
The OffscreenArea callback method:
$o:=cs.OffscreenArea.new()
$result:=VP Run offscreen area($o)
Exemple 2
Vous souhaitez charger un grand document hors écran, attendre que tous les calculs soient terminés et l'exporter au format PDF :
//cs.OffscreenArea class declaration
Class constructor($pdfPath : Text)
This.pdfPath:=$pdfPath
This.autoQuit:=False
This.isWaiting:=False
Function onEvent()
Case of
:(FORM Event.code=On VP Ready)
// Document import
VP IMPORT DOCUMENT(This.area;$largeDocument4VP)
This.isWaiting:=True
// Start a timer to verify if all calculations are finished.
// If during this period the "On VP Range Changed" is thrown, the timer will be restarted
// The time must be defined according to the computer configuration.
SET TIMER(60)
:(FORM Event.code=On VP Range Changed)
// End of calculation detected. Restarts the timer
If(This.isWaiting)
SET TIMER(60)
End if
:(FORM Event.code=On Timer)
// To be sure to not restart the timer if you call others 4D View command after this point
This.isWaiting:=False
// Stop the timer
SET TIMER(0)
// Start the PDF export
VP EXPORT DOCUMENT(This.area;This.pdfPath;New object("formula";Formula(ACCEPT)))
:(FORM Event.code=On URL Loading Error)
CANCEL
End case
The OffscreenArea callback method:
$o:=cs.OffscreenArea.new()
$result:=VP Run offscreen area($o)
Voir également
Blog post: End of document loading
S
VP SET ACTIVE CELL
VP SET ACTIVE CELL ( rangeObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage |
Description
The VP SET ACTIVE CELL
command defines a specified cell as active.
In rangeObj, pass a range containing a single cell as an object (see VP Cell). If rangeObj is not a cell range or contains multiple ranges, the first cell of the first range is used.
Exemple
Le code suivant déterminera comme active la cellule de la colonne D, ligne 5 :
$activeCell:=VP Cell("myVPArea";3;4)
VP SET ACTIVE CELL($activeCell)
Voir également
VP ADD SELECTION
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET SELECTION
VP SHOW CELL
VP SET ALLOWED METHODS
VP SET ALLOWED METHODS ( methodObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
methodObj | Object | -> | Allowed methods in the 4D View Pro areas |
Compatibility
For greater flexiblity, it is recommended to use the
VP SET CUSTOM FUNCTIONS
command which allows you to designate 4D formulas that can be called from 4D View Pro areas. As soon asVP SET CUSTOM FUNCTIONS
is called,VP SET ALLOWED METHODS
calls are ignored. 4D View Pro also supports 4D's genericSET ALLOWED METHODS
command if neitherVP SET CUSTOM FUNCTIONS
norVP SET ALLOWED METHODS
are called, however using the generic command is not recommended.
Description
The VP SET ALLOWED METHODS
command designates the project methods that can be called in 4D View Pro formulas. Cette commande s'applique à toutes les zones 4D View Pro qui ont été crées après l'appel de la commande durant la session. Elle peut être appelée à plusieurs reprises dans la même session pour créer différentes configurations.
By default for security reasons, if you do not execute the VP SET ALLOWED METHODS
command, no method call is allowed in 4D View Pro areas -- except if 4D's generic SET ALLOWED METHODS
command was used (see compatibility note). L'utilisation d'une méthode non autorisée dans une formule affiche une erreur #NAME? dans la zone 4D View Pro.
In the methodObj parameter, pass an object in which each property is the name of a function to define in the 4D View Pro areas:
Propriété | Type | Description | ||
---|---|---|---|---|
<functionName> | Object | Description de la fonction personnalisée. The <functionName> property name defines the name of the custom function to display in 4D View Pro formulas (no spaces allowed) | ||
method | Text | (obligatoire) Nom de la méthode projet 4D existante à autoriser | ||
parameters | Collection d'objets | Collection de paramètres (dans l'ordre dans lequel ils sont définis dans la méthode). | ||
[ ].name | Text | Name of a parameter to display for the <functionName> .Note: Parameter names must not contain space characters. | ||
[ ].type | Number | Type de paramètre. Supported types:Is Boolean Is date Is Integer Is object Is real Is text Is time Is object , the object has the same structure as the object returned by VP Get value . | ||
summary | Text | Description de la fonction à afficher dans 4D View Pro | ||
minParams | Number | Nombre minimum de paramètres | ||
maxParams | Number | Nombre maximum de paramètres. Si vous passez un nombre supérieur à la largeur de parameters, il est possible de déclarer des paramètres "optionnels" avec leur type par défaut |
Exemple
Vous souhaitez autoriser deux méthodes dans vos zones 4D View Pro :
C_OBJECT($allowed)
$allowed:=New object //parameter for the command
$allowed.Hello:=New object //create a first simple function named "Hello"
$allowed.Hello.method:="My_Hello_Method" //sets the 4D method
$allowed.Hello.summary:="Hello prints hello world"
$allowed.Byebye:=New object //create a second function with parameters named "Byebye"
$allowed.Byebye.method:="My_ByeBye_Method"
$allowed.Byebye.parameters:=New collection
$allowed.Byebye.parameters.push(New object("name";"Message";"type";Is text))
$allowed.Byebye.parameters.push(New object("name";"Date";"type";Is date))
$allowed.Byebye.parameters.push(New object("name";"Time";"type";Is time))
$allowed.Byebye.summary:="Byebye prints a custom timestamp"
$allowed.Byebye.minParams:=3
$allowed.Byebye.maxParams:=3
VP SET ALLOWED METHODS($allowed)
Une fois ce code exécuté, les fonctions définies peuvent être utilisées dans des formules 4D View Pro :
Dans les formules de 4D View Pro, les noms des fonctions sont automatiquement affichés en majuscules.
Voir également
4D functions
VP SET CUSTOM FUNCTIONS
VP SET BINDING PATH
Historique
Version | Modifications |
---|---|
v19 R5 | Ajout |
VP SET BINDING PATH ( rangeObj : Object ; dataContextAttribute : Text)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
dataContextAttribute | Text | -> | Name of the attribute to bind to rangeObj |
Description
The VP SET BINDING PATH
command binds an attribute from a sheet's data context to rangeObj. After you set a data context using the SET DATA CONTEXT method. When loaded, if the data context contains the attribute, the value of dataContextAttribute is automatically displayed in the cells in rangeObj.
In rangeObj, pass an object that is either a cell range or a combined range of cells.
- If rangeObj is a range with several cells, the command binds the attribute to the first cell of the range.
- If rangeObj contains several ranges of cells, the command binds the attribute to the first cell of each range.
In dataContextAttribute, pass the name of the attribute to bind to rangeObj. If dataContextAttribute is an empty string, the function removes the current binding.
Attributes of type collection are not supported. When you pass the name of a collection attribute, the command does nothing.
Exemple
Set a data context and bind the firstName
and lastName
attribute to cells:
var $p : Object
$p:=New object
$p.firstName:="Freehafer"
$p.lastName:="Nancy"
VP SET DATA CONTEXT("ViewProArea"; $p)
VP SET BINDING PATH(VP Cell("ViewProArea"; 0; 0); "firstName")
VP SET BINDING PATH(VP Cell("ViewProArea"; 1; 0); "lastName")
Voir également
VP Get binding path
VP Get data context
VP SET DATA CONTEXT
VP SET BOOLEAN VALUE
VP SET BOOLEAN VALUE ( rangeObj : Object ; boolValue : Boolean)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
boolValue | Boolean | -> | Boolean value to set |
Description
The VP SET BOOLEAN VALUE
command assigns a specified boolean value to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The boolValue parameter allows you to pass the boolean value (True or False) that will be assigned to the rangeObj.
Exemple
//Fixez la valeur de la cellule à False
VP SET BOOLEAN VALUE(VP Cell("ViewProArea";3;2);False)
Voir également
VP SET BORDER
VP SET BORDER ( rangeObj : Object ; borderStyleObj : Object ; borderPosObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
borderStyleObj | Object | -> | Objet contenant le style de bordure | |
borderPosObj | Object | -> | Object containing border placement |
Description
The VP SET BORDER
command applies the border style(s) defined in borderStyleObj and borderPosObj to the range defined in the rangeObj.
In rangeObj, pass a range of cells where the border style will be applied. If the rangeObj contains multiple cells, borders applied with VP SET BORDER
will be applied to the rangeObj as a whole (as opposed to the VP SET CELL STYLE
command which applies borders to each cell of the rangeObj). If a style sheet has already been applied, VP SET BORDER
will override the previously applied border settings for the rangeObj.
The borderStyleObj parameter allows you to define the style for the lines of the border. The borderStyleObj supports the following properties:
Propriété | Type | Description | Valeurs possibles |
---|---|---|---|
color | text | Defines the color of the border. Default = black. | CSS color "#rrggbb" syntax (preferred syntax), CSS color "rgb(r,g,b)" syntax (alternate syntax), CSS color name (alternate syntax) |
style | Integer | Defines the style of the border. Default = empty. | vk line style dash dot vk line style dash dot dot vk line style dashed vk line style dotted vk line style double vk line style empty vk line style hair vk line style medium vk line style medium dash dot vk line style medium dash dot dot vk line style medium dashed vk line style slanted dash dot vk line style thick vk line style thin |
You can define the position of the borderStyleObj (i.e., where the line is applied) with the borderPosObj:
Propriété | Type | Description |
---|---|---|
all | boolean | Style de la ligne de bordure appliqué à toutes les bordures. |
left | boolean | Style de la ligne de bordure appliqué à la bordure de gauche. |
top | boolean | Style de la ligne de bordure appliqué à la bordure supérieure. |
right | boolean | Style de la ligne de bordure appliqué à la bordure de droite. |
bottom | boolean | Style de la ligne de bordure appliqué à la bordure inférieure. |
outline | boolean | Style de la ligne de bordure appliqué uniquemet aux bordures extérieures. |
inside | boolean | Style de la ligne de bordure appliqué uniquemet aux bordures intérieures. |
innerHorizontal | boolean | Style de la ligne de bordure appliqué uniquemet aux bordures horizontales intérieures. |
innerVertical | boolean | Style de la ligne de bordure appliqué uniquemet aux bordures verticales intérieures. |
Exemple 1
Ce code applique la bordure suivante autour de la plage :
$border:=New object("color";"red";"style";vk line style thick)
$option:=New object("outline";True)
VP SET BORDER(VP Cells("ViewProArea";1;1;3;3);$border;$option)
Exemple 2
This code demonstrates the difference between VP SET BORDER
and setting borders with the VP SET CELL STYLE
command:
// Set borders using VP SET BORDER
$border:=New object("color";"red";"style";vk line style thick)
$option:=New object("outline";True)
VP SET BORDER(VP Cells("ViewProArea";1;1;3;3);$border;$option)
// // Set borders using VP SET CELL STYLE
$cellStyle:=New object
$cellStyle.borderBottom:=New object("color";"blue";"style";vk line style thick)
$cellStyle.borderRight:=New object("color";"blue";"style";vk line style thick)
VP SET CELL STYLE(VP Cells("ViewProArea";4;4;3;3);$cellStyle)
Voir également
VP SET CELL STYLE
VP SET CELL STYLE ( rangeObj : Object ; styleObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
styleObj | Object | -> | Objet style |
Description
The VP SET CELL STYLE
command applies the style(s) defined in the styleObj to the cells defined in the rangeObj.
In rangeObj, pass a range of cells where the style will be applied. If the rangeObj contains multiple cells, the style is applied to each cell.
Borders applied with
VP SET CELL STYLE
will be applied to each cell of the rangeObj, as opposed to the VP SET BORDER command which applies borders to the rangeObj as a whole.
The styleObj parameter lets you pass an object containing style settings. Vous pouvez utiliser une feuille de style existante ou créer un nouveau style. If the styleObj contains both an existing style sheet and additional style settings, the existing style sheet is applied first, followed by the additional settings.
Attribuez la valeur NULL pour supprimer un style et rétablir les paramètres de style par défaut (le cas échéant) :
- giving the styleObj parameter a NULL value will remove any style settings from the rangeObj,
- giving an attribute a NULL value will remove this specific attribute from the rangeObj.
For more information about style objects and style sheets, see the Style Objects paragraph.
Exemple
$style:=New object
$style.font:="8pt Arial"
$style.backColor:="Azure"
$style.foreColor:="red"
$style.hAlign:=1
$style.isVerticalText:=True
$style.borderBottom:=New object("color";"#800080";"style";vk line style thick)
$style.backgroundImage:=Null //remove a specific attribute
VP SET CELL STYLE(VP Cell("ViewProArea";1;1);$style)
Voir également
VP ADD STYLESHEET
VP Font to object
VP Get cell style
VP Object to font
VP SET BORDER
VP SET DEFAULT STYLE
VP SET COLUMN ATTRIBUTES
VP SET COLUMN ATTRIBUTES ( rangeObj : Object ; propertyObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
propertyObj | Object | -> | Object containing column properties |
Description
The VP SET COLUMN ATTRIBUTES
command applies the attributes defined in the propertyObj to the columns in the rangeObj.
In rangeObj, pass an object containing a range. Si la plage contient des colonnes et des lignes, les attributs s'appliquent uniquement aux colonnes.
The propertyObj parameter lets you specify the attributes to apply to the columns in the rangeObj. Ces attributs sont :
Propriété | Type | Description |
---|---|---|
width | number | Largeur de colonne exprimée en pixels |
pageBreak | boolean | Vrai pour insérer un saut de page avant la première colonne de la plage, sinon faux |
visible | boolean | Vrai si la colonne est visible, sinon faux |
resizable | boolean | Vrai si la colonne peut être redimensionnée, sinon faux |
header | text | Texte de l'en-tête de la colonne |
Exemple
Pour modifier la taille de la deuxième colonne et définir un en-tête, le code suivant :
C_OBJECT($column;$properties)
$column:=VP Column("ViewProArea";1) //column B
$properties:=New object("width";100;"header";"Hello World")
VP SET COLUMN ATTRIBUTES($column;$properties)
Voir également
VP Column
VP Get column attributes
VP Get row attributes
VP SET ROW ATTRIBUTES
VP SET COLUMN COUNT
VP SET COLUMN COUNT ( vpAreaName : Text , columnCount : Integer { , sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
columnCount | Integer | -> | Nombre de colonnes | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET COLUMN COUNT
command defines the total number of columns in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the total number of columns in the columnCount parameter. columnCount must be greater than 0.
In the optional sheet parameter, you can designate a specific spreadsheet where the columnCount will be applied (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
Le code suivant définit cinq colonnes dans la zone 4D View Pro :
VP SET COLUMN COUNT("ViewProArea";5)
Voir également
VP Get column count
VP Get row count
VP SET ROW COUNT
VP SET CURRENT SHEET
VP SET CURRENT SHEET ( vpAreaName : Text ; sheet : Integer)
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
sheet | Integer | <- | Index of the new current sheet |
Description
The VP SET CURRENT SHEET
command sets the current sheet in vpAreaName . La feuille courante est la feuille sélectionnée dans le document.
In vpAreaName, pass the name of the 4D View Pro area.
In sheet, pass the index of the sheet to be set as current sheet. If no index is specified or if you pass -1, the command applies to the current sheet.
La numérotation démarre à 0.
Exemple
The document's current sheet is the first sheet:
Set the current sheet to the third sheet:
VP SET CURRENT SHEET("ViewProArea";2)
Voir également
VP SET CUSTOM FUNCTIONS
VP SET CUSTOM FUNCTIONS ( vpAreaName : Text ; formulaObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
formulaObj | Object | -> | Objet formule |
Description
The VP SET CUSTOM FUNCTIONS
command designates the 4D formulas that can be called directly from 4D View Pro formulas. Because custom functions are not stored in the document,VP SET CUSTOM FUNCTIONS
must be executed in the On Load
form event.
The formulas specified by VP SET CUSTOM FUNCTIONS
appear in a pop-up menu when the first letter of their name is entered. See the Formulas and Functions page.
If
VP SET CUSTOM FUNCTIONS
is called multiple times for the same area, in the same session, only the last call is taken into account.
Pass the name of the 4D View Pro area in vpAreaName. Si vous passez un nom inexistant, une erreur est retournée.
In the formulaObj parameter, pass an object containing the 4D formulas that can be called from 4D View Pro formulas as well as additional properties. Each customFunction
property passed in formulaObj becomes the name of a function in the 4D View Pro area.
Propriété | Type | Description | ||
---|---|---|---|---|
<customFunction> | Object | Description de la fonction personnalisée. <customFunction> defines the name of the custom function to display in 4D View Pro formulas (no spaces allowed) | ||
formula | Object | Objet formule 4D (obligatoire). See the Formula command. | ||
parameters | Collection d'objets | Collection de paramètres (dans l'ordre dans lequel ils sont définis dans la formule) | ||
[ ].name | Text | Nom du paramètre à afficher dans 4D View Pro | ||
[ ].type | Number | Type de paramètre. Supported types:Is Boolean Is date Is Integer Is object Is real Is text Is time Is object , the object has the same structure as the object returned by VP Get value. | ||
summary | Text | Description de la formule à afficher dans 4D View Pro | ||
minParams | Number | Nombre minimum de paramètres | ||
maxParams | Number | Nombre maximum de paramètres. Passing a number higher than the length of parameters allows declaring "optional" parameters with default type |
WARNING
- As soon as
VP SET CUSTOM FUNCTIONS
is called, the methods allowed by the VP SET ALLOWED METHODS command (if any) are ignored in the 4D View Pro area.- As soon as
VP SET CUSTOM FUNCTIONS
is called, the functions based uponSET TABLE TITLES
andSET FIELD TITLES
commands are ignored in the 4D View Pro area.
Exemple
Vous souhaitez utiliser des objets Formule dans une zone 4D View Pro pour ajouter des chiffres, récupérer le sexe et le nom de famille d'un client :
Case of
:(FORM Event.code=On Load)
var $o : Object
$o:=New object
// Define "addnum" function from a method named "addnum"
$o.addnum:=New object
$o.addnum.formula:=Formula(addnum)
$o.addnum.parameters:=New collection
$o.addnum.parameters.push(New object("name";"num1";"type";Is Integer))
$o.addnum.parameters.push(New object("name";"num2";"type";Is Integer))
// Define "ClientLastName" function from a database field
$o.ClientLastName:=New object
$o.ClientLastName.formula:=Formula([Customers]lastname)
$o.ClientLastName.summary:="Lastname of the current client"
// Define "label" function from a 4D expression with one parameter
$o.label:=New object
$o.label.formula:=Formula(ds.Customers.get($1).label)
$o.label.parameters:=New collection
$o.label.parameters.push(New object("name";"ID";"type";Is Integer))
// Define "Title" function from a variable named "Title"
$o.Title:=New object
$o.Title.formula:=Formula(Title)
VP SET CUSTOM FUNCTIONS("ViewProArea";$o)
End case
Voir également
VP SET DATA CONTEXT
Historique
Version | Modifications |
---|---|
v19 R5 | Ajout |
VP SET DATA CONTEXT ( vpAreaName : Text ; dataObj : Object {; options : Object } {; sheet : Integer} )
VP SET DATA CONTEXT ( vpAreaName : Text ; dataColl : Collection ; {options : Object } {; sheet : Integer} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nom d'objet formulaire zone 4D View Pro | |
dataObj | Object | -> | Objet de données à charger dans le contexte de données | |
dataColl | Collection | -> | Collection de données à charger dans le contexte de données | |
options | Object | -> | Options supplémentaires | |
sheet | Integer | -> | Numéro d'indice de la feuille |
Description
The VP SET DATA CONTEXT
command sets the data context of a sheet. A data context is an object or a collection bound to a worksheet, and whose contents can be used to automatically fill the sheet cells, either by using an autogenerate option or the VP SET BINDING PATH method. On the other hand, the VP Get data context command can return a context containing user modifications.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
In dataObj or dataColl, pass an object or a collection containing the data to load in the data context. Les images sont converties en schémas URI de données.
To pass a time value in dataObj or dataColl, encapsulate it in an object with the following properties (see example 4):
Propriété | Type | Description |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Valeur à placer dans le contexte |
time | Real | Valeur heure (en secondes) à placer dans le contexte |
In options, you can pass an object that specifies additional options. Il peut contenir les propriétés suivantes :
Propriété | Type | Description |
---|---|---|
reset | Object | Vrai pour réinitialiser le contenu de la feuille avant de charger le nouveau contexte, Faux (par défaut) dans le cas contraire. |
autoGenerateColumns | Object | Utilisé uniquement lorsque les données sont une collection. Vrai (par défaut) pour spécifier que les colonnes doivent être générées automatiquement lorsque le contexte de données est lié. In this case, the following rules apply:
|
In sheet, pass the index of the sheet that will receive the data context. If no index is passed, the context is applied to the current sheet.
If you export your document to an object using VP Export to object, or to a 4DVP document using VP EXPORT DOCUMENT, the includeBindingSource
option lets you copy the contents of the current contexts as cell values in the exported object or document. For more details, refer to the description of those methods.
Exemple
Pass an object and bind the context data to cells in the first row:
var $data : Object
$data:=New object
$data.firstName:="Freehafer"
$data.lastName:="Nancy"
VP SET DATA CONTEXT("ViewProArea"; $data)
VP SET BINDING PATH(VP Cell("ViewProArea"; 0; 0); "firstName")
VP SET BINDING PATH(VP Cell("ViewProArea"; 1; 0); "lastName")
Exemple 2
Pass a collection of objects and generate columns automatically:
var $options : Object
var $data : Collection
$data:=New collection()
$data.push(New object("firstname"; "John"; "lastname"; "Smith"))
$data.push(New object("firstname"; "Mary"; "lastname"; "Poppins"))
$options:=New object("autoGenerateColumns"; True)
VP SET DATA CONTEXT("ViewProArea"; $data; $options)
Exemple 3
The data passed as a parameter is a collection that contains subcollections. Each subcollection defines the contents of a row:
var $data : Collection
var $options : Object
$data:=New collection
$data.push(New collection(1; 2; 3; False; "")) // 5 columns are created
$data.push(New collection) // Second row is empty
$data.push(New collection(4; 5; Null; "hello"; "world")) // Third row has 5 values
$data.push(New collection(6; 7; 8; 9)) // Fourth row has 4 values
$options:=New object("autoGenerateColumns"; True)
VP SET DATA CONTEXT("ViewProArea"; $data; $options)
Example 4 - Date and time syntax
var $data : Collection
var $options : Object
$data:= New collection()
// Dates can be passed as scalar values
$data.push(New collection("Date"; Current date))
// Time values must be passed as object attributes
$data.push(New collection("Time"; New object("time"; 5140)))
// Date + time example
$data.push(New collection("Date + Time"; New object("value"; Current date; "time"; 5140)))
$options:=New object("autoGenerateColumns"; True)
VP SET DATA CONTEXT("ViewProArea"; $data; $options)
Voici le résultat une fois les colonnes générées :
Voir également
VP SET BINDING PATH
VP Get binding path
VP Get data context
VP SET DATE TIME VALUE
VP SET DATE TIME VALUE ( rangeObj : Object ; dateValue : Date ; timeValue : Time {; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
dateValue | Date | -> | Valeur date à fixer | |
timeValue | Time | -> | Valeur heure à fixer | |
formatPattern | Text | -> | Format of value |
Description
The VP SET DATE TIME VALUE
command assigns a specified date and time value to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The dateValue parameter specifies a date value to be assigned to the rangeObj.
The timeValue parameter specifies a time value (expressed in seconds) to be assigned to the rangeObj.
The optional formatPattern defines a pattern for the dateValue and timeValue parameters. For information on patterns and formatting characters, please refer to the Date and time formats section.
Exemple
//Set the cell value as the current date and time
VP SET DATE TIME VALUE(VP Cell("ViewProArea";6;2);Current time;Current date;vk pattern full date time)
//Set the cell value as the 18th of December
VP SET DATE TIME VALUE(VP Cell("ViewProArea";3;9);!2024-12-18!;?14:30:10?;vk pattern sortable date time)
Voir également
4D View Pro cell format
VP SET DATE VALUE
VP SET TIME VALUE
VP SET VALUE
VP SET DATE VALUE
VP SET DATE VALUE ( rangeObj : Object ; dateValue : Date { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
dateValue | Date | -> | Valeur date à fixer | |
formatPattern | Text | -> | Format of value |
Description
The VP SET DATE VALUE
command assigns a specified date value to a designated cell range.
In rangeObj, pass a range of the cell(s) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The dateValue parameter specifies a date value to be assigned to the rangeObj.
The optional formatPattern defines a pattern for the dateValue parameter. Passez un format personnalisé ou utilisez ou utilisez l'une des constantes suivantes :
Constante | Description | Configuration par défaut des US |
---|---|---|
vk pattern long date | Format ISO 8601 long pour la date | "dddd, dd MMMM yyyy" |
vk pattern month day | Format ISO 8601 pour le mois et le jour | "MMMM dd" |
vk pattern short date | Format ISO 8601 court pour la date | "MM/dd/yyyy" |
vk pattern year month | Format ISO 8601 pour le mois et l'année | "yyyy MMMM" |
For information on patterns and formatting characters, please refer to the Date and time formats section.
Exemple
//Set the cell value to the current date
VP SET DATE VALUE(VP Cell("ViewProArea";4;2);Current date))
//Set the cell value to a specific date with a designated format
VP SET DATE VALUE(VP Cell("ViewProArea";4;4);Date("12/25/94");"d/m/yy ")
VP SET DATE VALUE(VP Cell("ViewProArea";4;6);!2005-01-15!;vk pattern month day)
Voir également
4D View Pro cell format
VP SET DATE TIME VALUE
VP SET VALUE
VP SET DEFAULT STYLE
VP SET DEFAULT STYLE ( vpAreaName : Text ; styleObj : Object { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
styleObj | Object | -> | Objet style | |
sheet | Integer | -> | Sheet index (default = current sheet) |
Description
The VP SET DEFAULT STYLE
command defines the style in the styleObj as the default style for a sheet.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
The styleObj lets you pass an object containing style settings. Vous pouvez utiliser une feuille de style existante ou créer un nouveau style. For more information, see the Style objects paragraph.
In the optional sheet parameter, you can designate a specific spreadsheet where the style will be defined. Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
$style:=New object
$style.hAlign:=vk horizontal align left
$style.font:="12pt papyrus"
$style.backColor:="#E6E6FA" //light purple color
VP SET DEFAULT STYLE("myDoc";$style)
Voir également
VP ADD STYLESHEET
VP Font to object
VP Get default style
VP Object to font
VP SET BORDER
VP SET CELL STYLE
VP SET FIELD
VP SET FIELD ( rangeObj : Object ; field : Pointer { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
champ | Pointer | -> | Référence au champ dans la structure virtuelle | |
formatPattern | Text | -> | Format of field |
Description
The VP SET FIELD
command assigns a 4D database virtual field to a designated cell range.
In rangeObj, pass a range of the cell(s) whose value you want to specify. If rangeObj includes multiple cells, the specified field will be linked in each cell.
The field parameter specifies a 4D database virtual field to be assigned to the rangeObj. The virtual structure name for field can be viewed in the formula bar. If any of the cells in rangeObj have existing content, it will be replaced by field.
The optional formatPattern defines a pattern for the field parameter. You can pass any valid custom format.
Exemple
VP SET FIELD(VP Cell("ViewProArea";5;2);->[TableName]Field)
Voir également
VP SET FORMULA
VP SET FORMULA ( rangeObj : Object ; formula : Text { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
formula | Text | -> | Formule ou méthode 4D | |
formatPattern | Text | -> | Format of field |
Description
The VP SET FORMULA
command assigns a specified formula or 4D method to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the formula specified will be linked in each cell.
The formula parameter specifies a formula or 4D method name to be assigned to the rangeObj.
If the formula is a string, use the period
.
as numerical separator and the comma,
as parameter separator. If a 4D method is used, it must be allowed with theVP SET ALLOWED METHODS
command.
The optional formatPattern defines a pattern for the formula.
You remove the formula in rangeObj by replacing it with an empty string ("").
Exemple 1
VP SET FORMULA(VP Cell("ViewProArea";5;2);"SUM($A$1:$C$10)")
Exemple 2
Pour supprimer la formule :
VP SET FORMULA(VP Cell("ViewProArea";5;2);"")
Exemple 3
VP SET FORMULA($range; "SUM(A1,B7,C11)") //"," pour séparer les paramètres
Voir également
Cell format
VP Get Formula
VP SET FORMULAS
VP SET VALUE
VP SET FORMULAS
VP SET FORMULAS ( rangeObj : Object ; formulasCol : Collection )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage de cellules | |
formulasCol | Collection | -> | Collection of formulas |
Description
The VP SET FORMULAS
command assigns a collection of formulas starting at the specified cell range.
In rangeObj, pass a range of the cell (created with VP Cell) whose formula you want to specify. If rangeObj includes multiple ranges, only the first range is used.
The formulasCol is a two-dimensional collection:
- La collection de premier niveau contient des sous-collections de formules. Chaque sous-collection définit une ligne.
- Chaque sous-collection définit les valeurs des cellules de la ligne. Les valeurs doivent être des éléments textuels contenant les formules à associer aux cellules.
If the formula is a string, use the period
.
as numerical separator and the comma,
as parameter separator. If a 4D method is used, it must be allowed with theVP SET ALLOWED METHODS
command.
You remove the formulas in rangeObj by replacing them with an empty string ("").
Exemple 1
$formulas:=New collection
$formulas.push(New collection("MAX(B11,C11,D11)";"myMethod(G4)")) // First row
$formulas.push(New collection("SUM(B11:D11)";"AVERAGE(B11:D11)")) // Second row
VP SET FORMULAS(VP Cell("ViewProArea";6;3);$formulas) // Set the cells with the formulas
myMethod:
$0:=$1*3.33
Exemple 2
Pour supprimer des formules :
$formulas:=New collection
$formulas.push(New collection("";"")) // first collection
$formulas.push(New collection("";"")) // second collection
VP SET FORMULAS(VP Cell("ViewProArea";0;0);$formulas) // Assign to cells
Voir également
VP Get Formulas
VP GET VALUESVP SET FORMULA
VP SET VALUES
VP SET FROZEN PANES
VP SET FROZEN PANES ( vpAreaName : Text ; paneObj : Object { ; sheet : Integer } )
Paramètres | Type | Description | |
---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
paneObj | Object | -> | Objet contenant des informations sur les colonnes et lignes figées |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET FROZEN PANES
command sets the frozen status of the columns and rows in the paneObj so they are always displayed in the vpAreaName. . Un trait continu s'affiche pour indiquer que des lignes et colonnes sont figées. L'emplacement du trait dépend de l'emplacement de la ligne ou colonne figée dans la feuille :
- Columns on the left or right: For columns on the left of the sheet, the line is displayed on the right side of the last frozen column. Pour les colonnes situées à droite de la feuille, le trait s'affiche sur le côté gauche de la prmeière colonne figée.
- Rows on the top or bottom: For rows at the top of the sheet, the line is displayed below the last frozen row. Pour les lignes situées en bas de la feuille, le trait s'affiche au-dessus de la première ligne figée.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
You can pass an object defining the columns and rows to freeze in the paneObj parameter. Si vous fixez la valeur d'une propriété de colonne ou de ligne à zéro, cela réinitialise (ne fige plus) la propriété. Si une propriété est définie sur une valeur inférieure à zéro, la commande ne fait rien. Vous pouvez passer :
Propriété | Type | Description |
---|---|---|
columnCount | Integer | Le nombre de colonnes figées sur la gauche de la feuille |
trailingColumnCount | Integer | Le nombre de colonnes figées sur la droite de la feuille |
rowCount | Integer | Le nombre de lignes figées en haut de la feuille |
trailingRowCount | Integer | Le nombre de lignes figées en bas de la feuille |
In the optional sheet parameter, you can designate a specific spreadsheet where the range will be defined (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
Vous souhaitez figer les trois premières colonnes de gauche, deux colonnes de droite et la première ligne :
C_OBJECT($panes)
$panes:=New object
$panes.columnCount:=3
$panes.trailingColumnCount:=2
$panes.rowCount:=1
VP SET FROZEN PANES("ViewProArea";$panes)
Voir également
VP SET NUM VALUE
VP SET NUM VALUE ( rangeObj : Object ; numberValue : Number { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
numberValue | Number | -> | Valeur du nombre à fixer | |
formatPattern | Text | -> | Format of value |
Description
The VP SET NUM VALUE
command assigns a specified numeric value to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The numberValue parameter specifies a numeric value to be assigned to the rangeObj.
The optional formatPattern defines a pattern for the numberValue parameter.
Exemple
//Set the cell value to 2
VP SET NUM VALUE(VP Cell("ViewProArea";3;2);2)
//Set the cell value and format it in dollars
VP SET NUM VALUE(VP Cell("ViewProArea";3;2);12.356;"_($* #,##0.00_)")
Voir également
VP SET PRINT INFO
VP SET PRINT INFO ( vpAreaName : Text ; printInfo : Object { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom de la zone 4D View Pro | |
printInfo | Object | -> | Objet contenant les attributs d'impression | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET PRINT INFO
command defines the attributes to use when printing the vpAreaName.
Pass the name of the 4D View Pro area to print in vpAreaName. Si vous passez un nom inexistant, une erreur est retournée.
You can pass an object containing definitions for various printing attributes in the printInfo parameter. To view the full list of the available attributes, see Print Attributes.
In the optional sheet parameter, you can designate a specific spreadsheet to print (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
Le code suivant imprimera une nouvelle zone 4D View Pro dans un document PDF :
var $printInfo : Object
//declare print attributes object
$printInfo:=New object
//define print attributes
$printInfo.headerCenter:="&BS.H.I.E.L.D. &A Sales Per Region"
$printInfo.firstPageNumber:=1
$printInfo.footerRight:="page &P of &N"
$printInfo.orientation:=vk print page orientation landscape
$printInfo.centering:=vk print centering horizontal
$printInfo.columnStart:=0
$printInfo.columnEnd:=8
$printInfo.rowStart:=0
$printInfo.rowEnd:=24
$printInfo.showGridLine:=True
//Add corporate logo
$printInfo.headerLeftImage:=logo.png
$printInfo.headerLeft:="&G"
$printInfo.showRowHeader:=vk print visibility hide
$printInfo.showColumnHeader:=vk print visibility hide
$printInfo.fitPagesWide:=1
$printInfo.fitPagesTall:=1
//print PDF document
VP SET PRINT INFO ("ViewProArea";$printInfo)
//export the PDF
VP EXPORT DOCUMENT("ViewProArea";"Sales2018.pdf";New object("formula";Formula(ALERT("PDF ready!"))))
Le PDF :
Voir également
4D View Pro print attributes
VP Convert to picture
VP Get print info
VP PRINT
VP SET ROW ATTRIBUTES
VP SET ROW ATTRIBUTES ( rangeObj : Object ; propertyObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Plage de lignes | |
propertyObj | Object | -> | Object containing row properties |
Description
The VP SET ROW ATTRIBUTES
command applies the attributes defined in the propertyObj to the rows in the rangeObj.
In the rangeObj, pass an object containing a range. Si la plage contient des colonnes et des lignes, les attributs s'appliquent uniquement aux lignes.
The propertyObj parameter lets you specify the attributes to apply to the rows in the rangeObj. Ces attributs sont :
Propriété | Type | Description |
---|---|---|
height | number | Hauteur de la ligne exprimée en pixels |
pageBreak | boolean | Vrai pour insérer un saut de page avant la première ligne de la plage, sinon faux |
visible | boolean | Vrai si la ligne est visible, sinon faux |
resizable | boolean | Vrai si la ligne peut être redimensionnée, sinon faux |
header | text | Texte de l'en-tête de la ligne |
Exemple
Pour modifier la taille de la deuxième ligne et définir l'en-tête, saisissez le code suivant :
var $row; $properties : Object
$row:=VP Row("ViewProArea";1)
$properties:=New object("height";75;"header";"June")
VP SET ROW ATTRIBUTES($row;$properties)
Voir également
VP Get row attributes
VP get column attributes
VP SET ROW ATTRIBUTES
VP SET ROW COUNT
VP SET ROW COUNT ( vpAreaName : Text ; rowCount : Integer { ; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
rowCount | Integer | -> | Nombre de lignes | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET ROW COUNT
command defines the total number of rows in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Pass the total number of rows in the rowCount parameter. rowCount must be greater than 0.
In the optional sheet parameter, you can designate a specific spreadsheet where the rowCount will be applied (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple
Le code suivant définit cinq lignes dans la zone 4D View Pro :
VP SET ROW COUNT("ViewProArea";5)
Voir également
VP Get column count
VP get row-count
VP SET COLUMN COUNT
VP SET SELECTION
VP SET SELECTION ( rangeObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage de toutes les cellules |
Description
The VP SET SELECTION
command defines the specified cells as the selection and the first cell as the active cell.
In rangeObj, pass a range object of cells to designate as the current selection.
Exemple
$currentSelection:=VP Combine ranges(VP Cells("myVPArea";3;2;1;6);VP Cells("myVPArea";5;7;1;7))
VP SET SELECTION($currentSelection)
Voir également
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP ADD SELECTION
VP SHOW CELL
VP SET SHEET COUNT
VP SET SHEET COUNT ( vpAreaName : Text ; number : Integer )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
number | Integer | -> | Number of sheets |
Description
The VP SET SHEET COUNT
command sets the number of sheets in vpAreaName.
In number
, pass a number corresponding to how many sheets the document will contain after the command is executed.
Warning: The command will delete sheets if the previous amount of sheets in your document is superior to the number passed. Par exemple, si votre document comporte 5 feuilles et que vous avez fixé le nombre de feuilles à 3, la commande supprimera les feuilles numérotées 4 et 5.
Exemple
Le document comporte actuellement une feuille :
Pour régler le nombre de feuilles sur 3 :
VP SET SHEET COUNT("ViewProArea";3)
Voir également
VP SET SHEET NAME
VP SET SHEET NAME ( vpAreaName : Text ; name : Text {; sheet: Integer} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
name | Text | -> | Nouveau nom de la feuille | |
sheet | Integer | -> | Index of the sheet to be renamed |
Description
The VP SET SHEET NAME
command renames a sheet in the document loaded in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In name, pass a new name for the sheet.
In sheet, pass the index of the sheet to rename.
La numérotation démarre à 0.
If no sheet is passed, the command renames the current sheet.
The new name cannot contain the following characters: *, :, [, ], ?,\,/
La commande ne fait rien si :
- le nouveau nom contient des caractères interdits
- la valeur du nouveau nom est vide
- le nouveau nom existe déjà
- the passed sheet index does not exist
Exemple
Le nom de la troisième feuille est "Total premier trimestre" :
VP SET SHEET NAME("ViewProArea";"Total first quarter";2)
VP SET SHEET OPTIONS
VP SET SHEET OPTIONS ( vpAreaName : Text; sheetOptions : Object { ; sheet : Integer} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nom de la zone 4D View Pro | |
sheetOptions | Object | -> | Option(s) de la feuille à définir | |
sheet | Object | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET SHEET OPTIONS
command allows defining various sheet options of the vpAreaName area.
Pass the name of the 4D View Pro area in vpAreaName. Si vous passez un nom inexistant, une erreur est retournée.
Pass an object containing definitions for the options to set in the sheetOptions parameter. To view the full list of the available options, see the Sheet Options paragraph.
In the optional sheet parameter, you can designate a specific spreadsheet (counting begins at 0). Si le paramètre est omis, la feuille courante est utilisée par défaut. Vous pouvez sélectionner explicitement la feuille courante à l'aide de la constante suivante :
vk current sheet
Exemple 1
Vous souhaitez protéger toutes les cellules à l'exception de la plage C5:D10 :
// Activate protection on the current sheet
var $options : Object
$options:=New object
$options.isProtected:=True
VP SET SHEET OPTIONS("ViewProArea";$options)
// mark cells C5:D10 as 'unlocked'
VP SET CELL STYLE(VP Cells("ViewProArea";2;4;2;6);New object("locked";False))
Exemple 2
Vous souhaitez protéger votre document pendant que vos utilisateurs redimensionnent les lignes et colonnes :
var $options : Object
$options:=New object
// Activate protection
$options.isProtected:=True
$options.protectionOptions:=New object
// Allow user to resize rows
$options.protectionOptions.allowResizeRows=True;
// Allow user to resize columns
$options.protectionOptions.allowResizeColumns=True;
// Apply protection on the current sheet
VP SET SHEET OPTIONS("ViewProArea";$options)
Exemple 3
Vous souhaitez personnaliser la couleur des onglets, des lignes figées, du quadrillage, du fond de la sélection et de la bordure de la sélection :
var $options : Object
$options:=New object
// Customize color of Sheet 1 tab
$options.sheetTabColor:="Black"
$options.gridline:=New object("color";"Purple")
$options.selectionBackColor:="rgb(255,128,0,0.4)"
$options.selectionBorderColor:="Yellow"
$options.frozenlineColor:="Gold"
VP SET SHEET OPTIONS("ViewProArea";$options;0)
// Customize color of Sheet 2 tab
$options.sheetTabColor:="red"
VP SET SHEET OPTIONS("ViewProArea";$options;1)
// Customize color of Sheet 3 tab
$options.sheetTabColor:="blue"
VP SET SHEET OPTIONS("ViewProArea";$options;2)
Résultat:
Exemple 4
Vous souhaitez masquer le quadrillage et les en-têtes des lignes et colonnes.
var $options : Object
$options:=New object
$options.gridline:=New object()
$options.gridline.showVerticalGridline:=False
$options.gridline.showHorizontalGridline:=False
$options.rowHeaderVisible:=False
$options.colHeaderVisible:=False
VP SET SHEET OPTIONS("ViewProArea";$options)
Résultat:
Voir également
4D View Pro sheet options
VP Get sheet options
VP SET SHOW PRINT LINES
VP SET SHOW PRINT LINES ( vpAreaName : Text {; visible : Boolean}{; sheet : Integer} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
visible | Boolean | -> | Lignes d'impression affichées si True (par défaut), cachées si False | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET SHOW PRINT LINES
command sets whether to display print preview lines in a spreadsheet..
In vpAreaName, pass the name of the 4D View Pro area.
In visible, pass True
to display the print lines, and False
to hide them. True
is passed by default.
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié, la commande s'applique à la feuille en cours.
La numérotation démarre à 0.
La position des lignes d'impression d'une feuille de calcul varie en fonction des sauts de page de cette feuille.
Exemple
Le code suivant affiche les lignes d'impression dans la deuxième feuille d'un document :
VP SET SHOW PRINT LINES("ViewProArea";True;1)
Avec un saut de page :
Voir également
VP SET TABLE COLUMN ATTRIBUTES
Historique
Version | Modifications |
---|---|
v19 R7 | Ajout |
VP SET TABLE COLUMN ATTRIBUTES ( vpAreaName : Text ; tableName : Text ; column : Integer ; attributes : Object {; sheet : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
column | Integer | -> | Numéro de colonne de la table | |
attributes | Object | -> | Attribute(s) to apply to the column | |
sheet | Integer | -> | Numéro d'indice de la feuille (feuille courante si omis) |
Description
The VP SET TABLE COLUMN ATTRIBUTES
command applies the defined attributes to the column in the tableName.
In vpAreaName, pass the name of the 4D View Pro area.
In the attributes parameter, pass an object that contains the properties to set:
Propriété | Type | Description |
---|---|---|
dataField | text | Nom de la propriété de la colonne de la table dans le contexte de données. |
name | text | Nom de la colonne de la table. Doit être unique dans la table. Si ce nom est déjà utilisé par une autre colonne, il n'est pas appliqué et un nom par défaut est automatiquement utilisé. |
formula | text | Définit la formule pour chaque cellule de la colonne. See Structured Reference Formulas in the SpreadJS documentation |
footerText | text | Valeur du pied de colonne. |
footerFormula | text | Formule de pied de colonne. |
filterButtonVisible | boolean | Sets whether the table column's filter button is displayed (default is True when the table is created). |
In sheet, pass the index of the target sheet. Si aucun numéro n'est spécifié ou si vous passez -1, la commande s'applique à la feuille courante.
La numérotation démarre à 0.
If tableName is not found or if column is higher than the number of columns, the command does nothing.
Exemple
Vous créez une table avec un contexte de données :
var $context;$options : Object
$context:=New object()
$context.col:=New collection()
$context.col.push(New object("name"; "Smith"; "firstname"; "John"; "salary"; 10000))
$context.col.push(New object("name"; "Wesson"; "firstname"; "Jim"; "salary"; 50000))
$context.col.push(New object("name"; "Gross"; "firstname"; "Maria"; "salary"; 10500))
VP SET DATA CONTEXT("ViewProArea"; $context)
//Define the columns for the table
$options:=New object()
$options.tableColumns:=New collection()
$options.tableColumns.push(New object("name"; "Last Name"; "dataField"; "name"))
$options.tableColumns.push(New object("name"; "Salary"; "dataField"; "salary"))
VP CREATE TABLE(VP Cells("ViewProArea"; 1; 1; 2; 3); "PeopleTable"; "col"; $options)
Vous souhaitez ensuite insérer une colonne contenant des données provenant du contexte de données et masquer certains boutons de filtrage :
//insert a column
VP INSERT TABLE COLUMNS("ViewProArea"; "PeopleTable"; 1; 1)
var $param : Object
$param:=New object()
// Bind the column to the firstname field from the datacontext
$param.dataField:="firstname"
// Change the default name of the column to "First name"
// and hide the filter button
$param.name:="First Name"
$param.filterButtonVisible:=False
VP SET TABLE COLUMN ATTRIBUTES("ViewProArea"; "PeopleTable"; 1; $param)
// Hide the filter button of the first column
VP SET TABLE COLUMN ATTRIBUTES("ViewProArea"; "PeopleTable"; 0; \
New object("filterButtonVisible"; False))
Voir également
VP CREATE TABLE
VP Find table
VP Get table column attributes
VP RESIZE TABLE
VP SET TABLE THEME
Historique
Version | Modifications |
---|---|
v19 R8 | Ajout |
VP SET TABLE THEME ( vpAreaName : Text ; tableName : Text ; options : cs.ViewPro.TableTheme )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
options | cs.ViewPro.TableTheme | -> | Table theme properties to modify |
Description
The VP SET TABLE THEME
command modifies the current theme of the tableName.
In vpAreaName, pass the name of the 4D View Pro area and in tableName, the name of the table to modify.
In the options parameter, pass an object of the cs.ViewPro.TableTheme
class that contains the theme properties to modify.
Exemple 1
Vous souhaitez définir un thème prédéfini pour une table :
var $param : cs.ViewPro.TableTheme
$param:=cs.ViewPro.TableTheme.new()
$param.theme:="medium2"
VP SET TABLE THEME("ViewProArea"; "myTable"; $param)
Exemple 2
Vous souhaitez obtenir ce rendu de colonne alterné :
var $param : cs.ViewPro.TableTheme
$param:=cs.ViewPro.TableTheme.new()
// Enable the band column rendering
$param.bandColumns:=True
$param.bandRows:=False
// Create the theme object with header and column styles
$param.theme:=cs.ViewPro.TableThemeOptions.new()
var $styleHeader; $styleColumn; $styleColumn2 : cs.ViewPro.TableStyle
$styleHeader:=cs.ViewPro.TableStyle.new()
$styleHeader.backColor:="Gold"
$styleHeader.foreColor:="#03045E"
$param.theme.headerRowStyle:=$styleHeader
$styleColumn1:=cs.ViewPro.TableStyle.new()
$styleColumn1.backColor:="SkyBlue"
$styleColumn1.foreColor:="#03045E"
$param.theme.firstColumnStripStyle:=$styleColumn1
$styleColumn2:=cs.ViewPro.TableStyle.new()
$styleColumn2.backColor:="LightCyan"
$styleColumn2.foreColor:="#03045E"
$param.theme.secondColumnStripStyle:=$styleColumn2
VP SET TABLE THEME("ViewProArea"; "myTable"; $param)
Voir également
VP CREATE TABLE
VP Get table theme
VP SET TEXT VALUE
VP SET TEXT VALUE ( rangeObj : Object ; textValue : Text { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
textValue | Text | -> | Valeur texte à fixer | |
formatPattern | Text | -> | Format of value |
Description
The VP SET TEXT VALUE
command assigns a specified text value to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The textValue parameter specifies a text value to be assigned to the rangeObj.
The optional formatPattern defines a pattern for the textValue parameter.
Exemple
VP SET TEXT VALUE(VP Cell("ViewProArea";3;2);"Test 4D View Pro")
Voir également
VP SET TIME VALUE
VP SET TIME VALUE ( rangeObj : Object ; timeValue : Text { ; formatPattern : Text } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
timeValue | Text | -> | Valeur heure à fixer | |
formatPattern | Text | -> | Format of value |
Description
The VP SET TIME VALUE
command assigns a specified time value to a designated cell range.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The timeValue parameter specifies a time expressed in seconds to be assigned to the rangeObj.
The optional formatPattern defines a pattern for the timeValue parameter.
Exemple
//Set the value to the current time
VP SET TIME VALUE(VP Cell("ViewProArea";5;2);Current time)
//Set the value to a specific time with a designated format
VP SET TIME VALUE(VP Cell("ViewProArea";5;2);?12:15:06?;vk pattern long time)
Voir également
Cell Format
VP SET DATE TIME VALUE
VP SET VALUE
VP SET VALUE
VP SET VALUE ( rangeObj : Object ; valueObj : Object )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
valueObj | Object | -> | Cell values and format options |
Description
The VP SET VALUE
command assigns a specified value to a designated cell range.
The command allows you to use a generic code to set and format the types of values in rangeObj, whereas other commands, such as VP SET TEXT VALUE
and VP SET NUM VALUE
, reduce the values to specific types.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell
or VP Column
) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The parameter valueObj is an object that includes properties for the value and the format to assign to rangeObj. Il peut contenir les propriétés suivantes :
Propriété | Type | Description |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Value to assign to rangeObj (except- time). Passez null pour effacer le contenu de la cellule. |
time | Real | Time value (in seconds) to assign to rangeObj |
format | Text | Modèle pour la propriété value/time. For information on patterns and formatting characters, please refer to the Cell Format paragraph. |
Exemple
//Set the cell value as False
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";False))
//Set the cell value as 2
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";2))
//Set the cell value as $125,571.35
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";125571.35;"format";"_($* #,##0.00_)"))
//Set the cell value as Hello World!
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";"Hello World!"))
//Set the cell value as current date
VP SET VALUE(VP Cell("ViewProArea";4;2);New object("value";Current date))
//Set the cell value as current hour
VP SET VALUE(VP Cell("ViewProArea";5;2);New object("time";Current hour))
//Set the cell value as specific date and time
VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";!2024-12-18!);"time";?14:30:10?;"format";vk pattern full date time))
//Erase cell content
VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";Null))
Voir également
Cell Format
VP Get values
VP SET VALUE
VP SET BOOLEAN VALUE
VP SET DATE TIME VALUE
VP SET FIELD
VP SET FORMULA
VP SET NUM VALUE
VP SET TEXT VALUE
VP SET TIME VALUE
VP SET VALUES
VP SET VALUES ( rangeObj : Object ; valuesCol : Collection )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
valuesCol | Collection | -> | Collection of values |
Description
The VP SET VALUES
command assigns a collection of values starting at the specified cell range.
In rangeObj, pass a range for the cell (created with VP Cell
) whose value you want to specify. The cell defined in the rangeObj is used to determine the starting point.
- If rangeObj is not a cell range, only the first cell of the range is used.
- If rangeObj includes multiple ranges, only the first cell of the first range is used.
The valuesCol parameter is two-dimensional:
- La collection de premier niveau contient des sous-collections de valeurs. Chaque sous-collection définit une ligne. Passez une collection vide pour sauter une ligne.
- Chaque sous-collection définit les valeurs des cellules de la ligne. Les valeurs peuvent être de type entier long, réel, booléen, texte, date, null ou objet. Si la valeur est un objet, elle peut avoir les propriétés suivantes :
Propriété | Type | Description |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Valeur dans la cellule (sauf heure) |
time | Real | Valeur heure (en secondes) |
Exemple
$param:=New collection
$param.push(New collection(1;2;3;False)) //first row, 4 values
$param.push(New collection) //second row, untouched
$param.push(New collection(4;5;Null;"hello";"world")) // third row, 5 values
$param.push(New collection(6;7;8;9)) // fourth row, 4 values
$param.push(New collection(Null;New object("value";Current date;"time";42))) //fifth row, 1 value
VP SET VALUES(VP Cell("ViewProArea";2;1);$param)
Voir également
VP Get formulas
VP Get value
VP Get Values
VP SET FORMULAS
VP SET VALUE
VP SET WORKBOOK OPTIONS
VP SET WORKBOOK OPTIONS ( vpAreaName : Text ; optionObj : Object)
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
optionObj | Object | -> | Object containing the workbook options to be set |
Description
VP SET WORKBOOK OPTIONS
sets the workbook options in vpAreaName.
In vpAreaName, pass the name of the 4D View Pro area.
In optionObj, pass the workbook options to apply to vpAreaName.
If optionObj is empty, the command does nothing.
Les options modifiées du classeur sont enregistrées avec le document.
Le tableau suivant répertorie les options de classeur disponibles :
Propriété | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
allowUserDragMerge | boolean | The drag merge operation is allowed (select cells and drag the selection to merge cells) | |||||||||||||||||||||
allowAutoCreateHyperlink | boolean | Enables automatic creation of hyperlinks in the spreadsheet. | |||||||||||||||||||||
allowContextMenu | boolean | The built-in context menu can be opened. | |||||||||||||||||||||
allowCopyPasteExcelStyle | boolean | Styles from a spreadsheet can be copied and pasted to Excel, and vice-versa. | |||||||||||||||||||||
allowDynamicArray | boolean | Enables dynamic arrays in worksheets | |||||||||||||||||||||
allowExtendPasteRange | boolean | Extends the pasted range if the pasted range is not enough for the pasted data | |||||||||||||||||||||
allowSheetReorder | boolean | Sheet reordering is allowed | |||||||||||||||||||||
allowUndo | boolean | Undoing edits is allowed. | |||||||||||||||||||||
allowUserDeselect | boolean | Deselecting specific cells from a selection is allowed. | |||||||||||||||||||||
allowUserDragDrop | boolean | Drag and drop of range data is allowed | |||||||||||||||||||||
allowUserDragFill | boolean | Drag fill is allowed | |||||||||||||||||||||
allowUserEditFormula | boolean | Formulas can be entered in cells | |||||||||||||||||||||
allowUserResize | boolean | Columns and rows can be resized | |||||||||||||||||||||
allowUserZoom | boolean | Zooming (ctrl + mouse wheel) is allowed | |||||||||||||||||||||
autoFitType | number | Content is formatted to fit in cells, or cells and headers. Available values:
| |||||||||||||||||||||
backColor | string | A color string used to represent the background color of the area, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5". The initial backgroundcolor is hidden when a backgroundImage is set. | |||||||||||||||||||||
backgroundImage | string / picture / file | Background image for the area. | |||||||||||||||||||||
backgroundImageLayout | number | How the background image is displayed. Available values:
| |||||||||||||||||||||
calcOnDemand | boolean | Formulas are calculated only when they are demanded. | |||||||||||||||||||||
columnResizeMode | number | Resize mode for columns. Available values:
| |||||||||||||||||||||
copyPasteHeaderOptions | number | Headers to include when data is copied to or pasted. Available values:
| |||||||||||||||||||||
customList | collection | The list for users to customize drag fill, prioritize matching this list in each fill. Each collection item is a collection of strings. See on SpreadJS docs. | |||||||||||||||||||||
cutCopyIndicatorBorderColor | string | Border color for the indicator displayed when the user cuts or copies the selection. | |||||||||||||||||||||
cutCopyIndicatorVisible | boolean | Display an indicator when copying or cutting the selected item. | |||||||||||||||||||||
defaultDragFillType | number | The default drag fill type. Available values :
| |||||||||||||||||||||
enableAccessibility | boolean | Accessibility support is enabled in the spreadsheet. | |||||||||||||||||||||
enableFormulaTextbox | boolean | The formula text box is enabled. | |||||||||||||||||||||
grayAreaBackColor | string | A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. | |||||||||||||||||||||
highlightInvalidData | boolean | Invalid data is highlighted. | |||||||||||||||||||||
iterativeCalculation | boolean | Enables iterative calculation. See on SpreadJS docs. | |||||||||||||||||||||
iterativeCalculationMaximumChange | numeric | Maximum amount of change between two calculation values. | |||||||||||||||||||||
iterativeCalculationMaximumIterations | numeric | Number of times the formula should recalculate. | |||||||||||||||||||||
newTabVisible | boolean | Display a special tab to let users insert new sheets. | |||||||||||||||||||||
numbersFitMode | number | Changes display mode when date/number data width is longer than column width. Available values:
| |||||||||||||||||||||
pasteSkipInvisibleRange | boolean | Paste or skip pasting data in invisible ranges:
| |||||||||||||||||||||
referenceStyle | number | Style for cell and range references in cell formulas. Available values:
| |||||||||||||||||||||
resizeZeroIndicator | number | Drawing policy when the row or column is resized to zero. Available values:
| |||||||||||||||||||||
rowResizeMode | number | The way rows are resized. Available values are the same as columnResizeMode | |||||||||||||||||||||
scrollbarAppearance | number | Scrollbar appearance. Available values:
| |||||||||||||||||||||
scrollbarMaxAlign | boolean | The scroll bar aligns with the last row and column of the active sheet. | |||||||||||||||||||||
scrollbarShowMax | boolean | The displayed scroll bars are based on the entire number of columns and rows in the sheet. | |||||||||||||||||||||
scrollByPixel | boolean | Enable precision scrolling by pixel. | |||||||||||||||||||||
scrollIgnoreHidden | boolean | The scroll bar ignores hidden rows or columns. | |||||||||||||||||||||
scrollPixel | entier | Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta * scrollPixel . For example: scrolling delta is 3, scrollPixel is 5, the final scrolling pixels are 15. | |||||||||||||||||||||
showDragDropTip | boolean | Display the drag-drop tip. | |||||||||||||||||||||
showDragFillSmartTag | boolean | Display the drag fill dialog. | |||||||||||||||||||||
showDragFillTip | boolean | Display the drag-fill tip. | |||||||||||||||||||||
showHorizontalScrollbar | boolean | Display the horizontal scroll bar. | |||||||||||||||||||||
showResizeTip | number | How to display the resize tip. Available values:
| |||||||||||||||||||||
showScrollTip | number | How to display the scroll tip. Available values:
| |||||||||||||||||||||
showVerticalScrollbar | boolean | Display the vertical scroll bar. | |||||||||||||||||||||
tabEditable | boolean | The sheet tab strip can be edited. | |||||||||||||||||||||
tabNavigationVisible | boolean | Display the sheet tab navigation. | |||||||||||||||||||||
tabStripPosition | number | Position of the tab strip. Available values:
| |||||||||||||||||||||
tabStripRatio | number | Percentage value (0.x) that specifies how much of the horizontal space will be allocated to the tab strip. The rest of the horizontal area (1 - 0.x) will allocated to the horizontal scrollbar. | |||||||||||||||||||||
tabStripVisible | boolean | Display the sheet tab strip. | |||||||||||||||||||||
tabStripWidth | number | Width of the tab strip when position is left or right. Default and minimum is 80. | |||||||||||||||||||||
useTouchLayout | boolean | Whether to use touch layout to present the Spread component. |
Exemple
Pour définir l'option allowExtendpasteRange dans "ViewProArea" :
var $workbookOptions : Object
$workbookOptions:= New Object
$workbookOptions.allowExtendPasteRange:=True
VP SET WORKBOOK OPTIONS("ViewProArea";$workbookOptions)
Voir également
VP SHOW CELL
VP SHOW CELL ( rangeObj : Object { ; vPos : Integer; hPos : Integer } )
Paramètres | Type | Description | ||
---|---|---|---|---|
rangeObj | Object | -> | Objet plage | |
vPos | Integer | -> | Position verticale de la vue de la cellule ou de la ligne | |
hPos | Integer | -> | Horizontal view position of cell or row |
Description
The VP SHOW CELL
command vertically and horizontally repositions the view of the rangeObj.
In rangeObj, pass a range of cells as an object to designate the cells to be viewed. The view of the rangeObj will be positioned vertically or horizontally (i.e., where rangeObj appears) based on the vPos and hPos parameters. The vPos parameter defines the desired vertical position to display the rangeObj, and the hPos parameter defines the desired horizontal position to display the rangeObj.
Les sélecteurs suivants sont disponibles :
Sélecteur | Description | Available with vPos | Available with hPos |
---|---|---|---|
vk position bottom | Alignement vertical vers le bas de la cellule ou de la ligne. | X | |
vk position center | Alignement vers le centre. The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position left | Alignement horizontal vers la gauche de la cellule ou de la colonne | X | |
vk position nearest | Alignement vers la limite la plus proche (haut, bas, gauche, droite, centre). The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position right | Alignement horizontal vers la droite de la cellule ou de la colonne | X | |
vk position top | Alignement vertical vers le haut de la cellule ou de la ligne | X |
Cette commande n'est efficace que si le repositionnement de la vue est possible. For example, if the rangeObj is in cell A1 (the first column and the first row) of the current sheet, repositioning the view will make no difference because the vertical and horizontal limits have already been reached (i.e., it is not possible to scroll any higher or any more to the left). The same is true if rangeObj is in cell C3 and the view is repositioned to the center or the bottom right. La vue demeure inchangée.
Exemple
Vous souhaitez visualiser la cellule dans la colonne AY, ligne 51, au centre de la zone 4D View Pro.
$displayCell:=VP Cell("myVPArea";50;50)
// Déplacez la vue pour afficher la cellule
VP SHOW CELL($displayCell;vk position center;vk position center)
Résultat:
Le même code ainsi que les sélecteurs verticaux et horizontaux ont été modifiés pour afficher la même cellule en haut à droite de la zone 4D View Pro :
$displayCell:=VP Cell("myVPArea";50;50)
// Déplacez la vue pour afficher la cellule
VP SHOW CELL($displayCell;vk position top;vk position right)
Résultat:
Voir également
VP ADD CELL
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
VP SUSPEND COMPUTING
VP SUSPEND COMPUTING ( vpAreaName : Text )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro |
Description
The VP SUSPEND COMPUTING
command stops the calculation of all formulas in vpAreaName. Cette commande est utile lorsque vous souhaitez suspendre les calculs dans cette zone 4D View Pro, afin de modifier manuellement les formules sans générer d'erreurs avant la fin de vos modifications.
La commande met en pause les calculs dans 4D View Pro. Formulas that have already been calculated remain unchanged, however any formulas added after VP SUSPEND COMPUTING
command is executed are not calculated.
In vpAreaName, pass the name of the 4D View Pro area. Si vous passez un nom inexistant, une erreur est retournée.
Le service de calcul de 4D View Pro maintient un compteur d'actions de suspension/reprise. Therefore, each execution of
VP SUSPEND COMPUTING
command must be balanced by a corresponding execution of theVP RESUME COMPUTING
command. Toute formule modifiée durant la phase de suspension des calculs sera recalculée lorsque la commande sera exécutée.
Exemple
Vous avez ajouté deux boutons au formulaire afin que l'utilisateur puisse suspendre/reprendre les calculs :
Le code du bouton Suspend Computing :
//pause calculations while users enter information
If(FORM Event.code=On Clicked)
VP SUSPEND COMPUTING("ViewProArea")
End if
If(FORM Event.code=On Clicked)
VP RESUME COMPUTING("ViewProArea")
End if