Aller au contenu principal
Version: Next

VP SET SHEET OPTIONS

VP SET SHEET OPTIONS ( vpAreaName : Text; sheetOptions : Object { ; sheet : Integer} )

ParamètresTypeDescription
vpAreaNameObject->Nom de la zone 4D View Pro
sheetOptionsObject->Option(s) de la feuille à définir
sheetObject->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