Lista de los métodos
Atención: los comandos de esta página no son hilo seguro.
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
vpFormula | Text | -> | Fórmula 4D View Pro | |
name | Text | -> | Nombre de la fórmula | |
options | Object | -> | Opciones de la fórmula temporal |
Descripción
El comando VP ADD FORMULA NAME
crea o modifica una fórmula temporal en el documento abierto.
Las fórmulas temporales creadas por este comando se guardan en el documento.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Pase la fórmula 4D View Pro que desea nombrar en vpFormula. Para obtener información detallada sobre la sintaxis de las fórmulas, consulte la página Fórmulas y funciones.
Pase el nuevo nombre para la fórmula en name. Si el nombre ya se utiliza en el mismo alcance, la nueva fórmula nombrada sustituye la existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante).
Puede pasar un objeto con las propiedades adicionales para la fórmula nombrada en options. Se soportan las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
scope | Number | Alcance de la fórmula. Puede pasar el índice de hojas (el conteo comienza en 0) o usar las siguientes constantes: vk current sheet vk workbook vk current sheet ), o global en todo el libro de trabajo (scope=vk workbook ). |
comment | Text | Comentario asociado a una fórmula nombrada |
Ejemplo
VP ADD FORMULA NAME("ViewProArea";"SUM($A$1:$A$10)";"Total2")
Ver también
Cell references
VP Get formula by name
VP Get names
VP ADD RANGE NAME
VP ADD RANGE NAME ( rangeObj : Object ; name : Text { ; options : Object } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
name | Text | -> | Nombre de la fórmula | |
options | Object | -> | Opciones de la fórmula temporal |
Descripción
El comando VP ADD RANGE NAME
crea o modifica un rango con nombre en el documento abierto.
Los rangos nombrados creados por este comando se guardan con el documento.
En rangeObj, pase el rango que quiere nombrar, y pase el nuevo nombre del rango en name. Si el nombre ya se utiliza en el mismo alcance, el nuevo rango nombrado sustituye al existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante).
Puede pasar un objeto con las propiedades adicionales para el rango nombrado en options. Se soportan las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
scope | Number | Alcance del rango. Puede pasar el índice de hojas (el conteo comienza en 0) o usar las siguientes constantes: vk current sheet vk workbook vk current sheet ), o global en todo el libro de trabajo (scope=vk workbook ). |
comment | Text | Comentario asociado al rango nombrado |
- Un rango nombrado es en realidad una fórmula nombrada que contiene coordenadas.
VP ADD RANGE NAME
facilita la creación de rangos temporales, pero también puede utilizar el métodoVP ADD FORMULA NAME
para crear rangos temporales.- Las fórmulas que definen rangos con nombre pueden recuperarse con el método
VP Get formula by name
.
Ejemplo
Quiere crear un rango nombrado para un rango de celdas:
$range:=VP Cell("ViewProArea";2;10)
VP ADD RANGE NAME($range;"Total1")
Ver también
VP ADD SELECTION
VP ADD SELECTION ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Text | -> | Objeto rango |
Descripción
El comando VP ADD SELECTION
añade las celdas especificadas a las celdas actualmente seleccionadas.
En rangeObj, pase un objeto rango de varias celdas para añadir a la selección actual.
La celda activa no se modifica.
Ejemplo
Actualmente tienes celdas seleccionadas:
El siguiente código añadirá celdas a su selección:
$currentSelection:=VP Cells("myVPArea";3;4;2;3)
VP ADD SELECTION($currentSelection)
Resultado:
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Indice de la nueva hoja | |
name | Text | -> | Nombre de la hoja |
Descripción
El comando VP ADD SHEET
inserta una hoja en el documento cargado en vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, puede pasar un índice para la nueva hoja. Si el index pasado es inferior o igual a 0, el comando inserta la nueva hoja al principio. Si el index supera el número de hojas, el comando inserta la nueva hoja después de las existentes.
La indexación comienza en 0.
En name, puede pasar un nombre para la nueva hoja. El nuevo nombre no puede contener los siguientes caracteres: *, :, [, ], ?,\,/
Ejemplo
El documento tiene actualmente 3 hojas:
Para insertar una hoja en la tercera posición (índice 2) y nombrarla "March":
VP ADD SHEET("ViewProArea";2;"March")
Ver también
VP ADD SPAN
VP ADD SPAN ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
El comando VP ADD SPAN
combina las celdas de rangeObj como un único tramo de celdas.
En rangeObj, pase un rango de celdas. Las celdas del rango se unen para crear una celda más grande que se extiende por varias columnas y/o líneas. Puede pasar varios rangos de celdas para crear varios espacios al mismo tiempo. Tenga en cuenta que si los rangos de celdas se superponen, sólo se utiliza el primer rango de celdas.
- Sólo se muestran los datos de la celda superior izquierda. Los datos de las otras celdas combinadas se ocultan hasta que se elimina la fusión.
- Los datos ocultos en las celdas fusionadas son accesibles mediante fórmulas (empezando por la celda superior izquierda).
Ejemplo
Para fusionar las celdas First quarter y Second quarter a través de las dos celdas al lado, y de fusionar la celda del área South a través de las dos líneas debajo de ella:
// Rango First quarter
$q1:=VP Cells("ViewProArea";2;3;3;1)
// Rango Second quarter
$q2:=VP Cells("ViewProArea";5;3;3;1)
// Rango South area
$south:=VP Cells("ViewProArea";0;5;1;3)
VP ADD SPAN(VP Combine ranges($q1;$q2;$south))
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
styleName | Text | -> | Nombre del estilo | |
styleObj | Object | -> | Objeto definiendo las propiedades del atributo | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
El comando VP ADD STYLESHEET
crea o modifica la hoja de estilo styleName basándose en la combinación de las propiedades especificadas en styleObj en el documento abierto. Si ya existe una hoja de estilo con el mismo nombre e índice en el documento, este comando la sobrescribirá con los nuevos valores.
Las hojas de estilo creadas por este comando se guardan con el documento.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El parámetro styleName permite asignar un nombre a la hoja de estilo. Si el nombre ya se utiliza dentro del mismo alcance, la nueva hoja de estilo sustituye a la existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante).
Dentro del styleObj, designe la configuración de la hoja de estilo (por ejemplo, fuente, decoración del texto, alineación, bordes, etc.). Para ver la lista completa de propiedades de estilo, consulte Propiedades de los objetos de estilo.
Puede designar dónde definir la hoja de estilo en el parámetro opcional sheet utilizando el índice de la hoja (la indexación comienza en 0) o con las siguientes constantes:
vk current sheet
vk workbook
Si una hoja de estilo styleName está definida al nivel del libro de trabajo y de la hoja, el nivel de hoja tiene prioridad sobre el nivel del libro de trabajo cuando se define la hoja de estilo.
Para aplicar la hoja de estilo, utilice los comandos VP SET DEFAULT STYLE o VP SET CELL STYLE.
Ejemplo
El código siguiente:
$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)
//Para aplicar el estiloVP SET CELL STYLE(VP Cells("ViewProArea";1;1;2;2);New object("name";"GreenDashDotStyle"))
creará y aplicará el siguiente objeto estilo llamado GreenDashDotStyle:
{
backColor:green,
borderBottom:{color:green,style:10},
borderLeft:{color:green,style:10},
borderRight:{color:green,style:10},
borderTop:{color:green,style:10}
}
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto rango de todas las celdas |
Descripción
El comando VP ALL
devuelve un nuevo objeto de rango que hace referencia a todas las celdas.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
Desea definir un objeto rango para todas las celdas de la hoja de cálculo actual:
$all:=VP All("ViewProArea") // todas las celdas de la hoja actual
Ver también
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
Parámetros | Tipo | Descripción | |
---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
column | Longint | -> | Índice de la columna |
row | Longint | -> | Índice de la línea |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Result | Object | <- | Objeto rango de una sola celda |
Descripción
El comando VP Cell
devuelve un nuevo objeto de rango que hace referencia a una celda específica.
Este comando se aplica a los rangos de una sola celda. Para crear un objeto de rango para múltiples celdas, utilice el comando VP Cells.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El parámetro column define la columna de la posición del rango de celdas. Pase el índice de columna en este parámetro.
El parámetro row define la línea del rango de celdas. Pase el índice de la línea en este parámetro.
En el parámetro opcional sheet, puede designar el índice de la hoja en donde se definirá el rango. Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual por defecto.
la indexación comienza en 0.
Ejemplo
Desea definir un objeto rango para la celda mostrada abajo (en la hoja actual):
El código es el siguiente:
$cell:=VP Cell("ViewProArea";2;4) // C5
Ver también
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
Historia
Versión | Modificaciones |
---|---|
v17 R4 | Añadidos |
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
column | Integer | -> | Índice de la columna | |
row | Integer | -> | Índice de la línea | |
columnCount | Integer | -> | Número de columnas | |
rowCount | Integer | -> | Número de líneas | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto rango de celdas |
Descripción
El comando VP Cells
devuelve un nuevo objeto de rango que hace referencia a celdas específicas.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El parámetro column define la primera columna del rango de celdas. Pase el índice de la columna (la numeración comienza en 0) en este parámetro. Si el rango está dentro de varias columnas, también debe utilizar el parámetro columnCount.
En el parámetro row, puede definir la(s) línea(s) del rango de celdas. Pase el índice de la línea (el conteo comienza en 0) en este parámetro. Si el rango contiene varias líneas, también debe utilizar el parámetro rowCount.
El parámetro columnCount permite definir el número total de columnas en las que se encuentra el rango. columnCount debe ser mayor que 0.
El parámetro rowCount permite definir el número total de líneas en las que se encuentra el rango. rowCount debe ser mayor que 0.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual por defecto.
Ejemplo
Desea definir un objeto rango para las siguientes celdas (de la hoja actual):
El código es el siguiente:
$cells:=VP Cells("ViewProArea";2;4;2;3) // de C5 a D7
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
column | Integer | -> | Índice de la columna | |
columnCount | Integer | -> | Número de columnas | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto rango de celdas |
Descripción
El comando VP Column
devuelve un nuevo objeto de rango que hace referencia a una columna o columnas específicas.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El parámetro column define la primera columna del rango. Pase el índice de la columna (el conteo comienza en 0) en este parámetro. Si el rango contiene varias columnas, también debe utilizar el parámetro opcional columnCount.
El parámetro opcional columnCount permite definir el número total de columnas en las que se encuentra el rango. columnCount debe ser mayor que 0. Si se omite, el valor se establecerá en 1 por defecto y se creará un rango de tipo de columna.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual por defecto.
Ejemplo
Desea definir un objeto rango para la columna mostrada abajo (en la hoja actual):
El código es el siguiente:
$column:=VP Column("ViewProArea";3) // columna D
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
El comando VP COLUMN AUTOFIT
dimensiona automáticamente la(s) columna(s) en rangeObj según su contenido.
En rangeObj, pase un objeto de rango que contenga un rango de columnas cuyo tamaño se manejará automáticamente.
Ejemplo
Las siguientes columnas tienen el mismo tamaño y no muestran parte del texto:
La selección de las columnas y la ejecución de este código:
VP COLUMN AUTOFIT(VP Get selection("ViewProarea"))
... redimensiona las columnas para ajustarse al tamaño de los contenidos:
Ver también
VP Combine ranges
VP Combine ranges ( rangeObj : Object ; otherRangeObj : Object {;...otherRangeObjN : Object } ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
otherRangeObj | Object | -> | Objeto rango | |
Result | Object | <- | Objeto que contiene un rango combinado |
Descripción
El comando VP Combine Ranges
devuelve un nuevo objeto de rango que incorpora dos o más objetos de rango existentes. Todos los rangos deben ser de la misma área 4D View Pro.
En rangeObj, pase el primer rango.
En otherRangeObj, pase otro objeto(s) rango para combinar con rangeObj.
El comando incorpora rangeObj y otherRangeObj por referencia.
Ejemplo
Quiere combinar los rangos de tipo celda, columna y línea en un nuevo rango distinto:
$cell:=VP Cell("ViewProArea";2;4) // C5
$column:=VP Column("ViewProArea";3) // columna D
$row:=VP Row("ViewProArea";9) // línea 10
$combine:=VP Combine ranges($cell;$column;$row)
Ver también
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
Parámetros | Tipo | Descripción | |
---|---|---|---|
4DViewDocument | Blob | -> | Documento 4D View |
Result | Object | <- | Objeto 4D View Pro |
Descripción
El comando VP Convert from 4D View
permite convertir un documento heredado de 4D View en un objeto 4D View Pro.
Este comando no requiere que el plug-in 4D View esté instalado en su entorno.
En el parámetro 4DViewDocument, pase una variable o un campo BLOB que contenga el documento 4D View a convertir. El comando devuelve un objeto 4D View Pro en el que toda la información almacenada originalmente en el documento 4D View se convierte en atributos 4D View Pro.
Ejemplo
Quiere obtener un objeto 4D View Pro a partir de un área 4D View almacenada en 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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpObject | Object | -> | Objeto 4D View Pro que contiene el área a convertir | |
rangeObj | Object | -> | Objeto rango | |
Result | Object | <- | Imagen SVG del área |
Descripción
El comando VP Convert to picture
convierte el objeto vpObject de 4D View Pro (o el rango rangeObj dentro de vpObject) en una imagen SVG.
Este comando es útil, por ejemplo:
- para integrar un documento de 4D View Pro en otro documento, como un documento de 4D Write Pro
- para imprimir un documento 4D View Pro sin tener que cargarlo en un área de 4D View Pro.
En vpObject, pase el objeto 4D View Pro a convertir. Este objeto debe haber sido analizado previamente usando VP Export to object o guardado utilizando VP EXPORT DOCUMENT.
El proceso de conversión a SVG requiere que las expresiones y formatos (cf. Formato de celda) incluidos en el área 4D View Pro se evalúen al menos una vez, para que puedan exportarse correctamente. Si convierte un documento que no ha sido evaluado previamente, las expresiones o los formatos pueden aparecer de forma inesperada.
En rangeObj, pase un rango de celdas a convertir. Por defecto, si se omite este parámetro, se convierte todo el contenido del documento.
El contenido del documento se convierte con respecto a sus atributos de visualización, incluidos los formatos (ver la nota anterior), la visibilidad de los encabezados, las columnas y las líneas. La conversión de los siguientes elementos es soportada:
- Texto: estilo / fuente / tamaño / alineación / orientación / rotación / formato
- Fondo de la celda : color / imagen
- Bordes de las celdas : grosor / color / estilo
- Fusión de celdas
- Imágenes
- Altura de líneas
- Ancho de columnas
- Columnas / líneas ocultas.
La visibilidad de la rejilla depende del atributo del documento definido con VP SET PRINT INFO.
Resultado
El comando devuelve una imagen en formato SVG.
Ejemplo
Quiere convertir un área 4D View Pro en SVG, previsualizar el resultado y enviarlo a una variable imagen:
C_OBJECT($vpAreaObj)
C_PICTURE($vPict)
$vpAreaObj:=VP Export to object("ViewProArea")
$vPict:=VP Convert to picture($vpAreaObj) //exportar toda el área
Ver también
VP EXPORT DOCUMENT
VP Export to object
VP SET PRINT INFO
VP Copy to object
Historia
Versión | Modificaciones |
---|---|
v19 R4 | Añadidos |
VP Copy to object ( rangeObj : Object {; options : Object} ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
options | Object | -> | Opciones adicionales | |
Result | Object | <- | Objeto devuelto. Contiene los datos copiados |
Descripción
El comando VP Copy to object
copia el contenido, estilo y fórmulas de rangeObj a un objeto.
En rangeObj, pase el rango de celdas con los valores, formato y fórmulas a copiar. Si rangeObj es un rango combinado, sólo se utiliza el primero.
Puede pasar un parámetro opcional options con las siguientes propiedades:
Propiedad | Tipo | Descripción | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
copy | Boolean | True (por defecto) para mantener los valores, el formato y las fórmulas copiados después de la ejecución del comando. False para eliminarlos. | ||||||||||||||
copyOptions | Longint | Especifica lo que se copia o mueve. Valores posibles:
|
Se tienen en cuenta las opciones de pegado definidas en las opciones del libro de trabajo.
El comando devuelve un objeto que contiene los datos copiados.
Ejemplo
Este ejemplo de código primero almacena el contenido, los valores, el formato y las fórmulas de un rango a un objeto, y luego los pega en otro rango:
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)
Ver también
VP PASTE FROM OBJECT
VP MOVE CELLS
VP Get workbook options
VP SET WORKBOOK OPTIONS
VP CREATE TABLE
Historia
Versión | Modificaciones |
---|---|
v19 R8 | Soporte de opciones de tema: bandColumns , bandRows , highlightFirstColumn , highlightLastColumn , theme |
v19 R7 | Soporte de la opción allowAutoExpand |
v19 R6 | Añadidos |
VP CREATE TABLE ( rangeObj : Object ; tableName : Text {; source : Text} {; options : cs.ViewPro.TableOptions} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
tableName | Text | -> | Nombre de la tabla | |
source | Text | -> | Nombre de la propiedad del contexto de datos a mostrar en la tabla | |
options | cs.ViewPro.TableOptions | -> | Opciones adicionales |
Descripción
El comando VP CREATE TABLE
crea una tabla en el rango especificado. Puede crear una tabla en un rango de celdas para facilitar la gestión y el análisis de un grupo de datos relacionados. Una tabla suele contener datos relacionados en filas y columnas, y aprovecha un contexto de datos.
En rangeObj, pase el rango de celdas donde se creará la tabla.
En tableName, introduzca un nombre para la tabla. El nombre debe:
- ser único en la hoja
- incluir al menos 5 caracteres
- no incluir espacios o empezar con un número
En source, puede pasar un nombre de propiedad de un contexto de datos para mostrar sus datos en la tabla. Esto vincula la tabla al contexto de datos. Cuando se actualiza el contexto de los datos, los datos mostrados en la tabla se actualizan en consecuencia. La propiedad source debe contener una colección de objetos y cada elemento representa una fila.
- Si no especifica una source, el comando crea una tabla vacía con el tamaño definido en rangeObj.
- Si la source especificada no se puede mostrar completamente en el documento, no se crea ninguna tabla.
En el parámetro options, pase un objeto de la clase cs.ViewPro.TableOptions
que contenga las propiedades de la tabla a definir.
Dentro del objeto options, la colección tableColumns determina la estructura de las columnas de la tabla. La longitud de la colección tableColumns debe ser igual al recuento de columnas del rango:
- Cuando el conteo de columnas en rangeObj excede el número de columnas en tableColumns, la tabla se llena con columnas vacías adicionales.
- Cuando la cuenta de columnas en rangeObj es inferior al número de tableColumns, la tabla muestra un número de columnas que coinciden con el recuento de columnas del rango.
Si pasa una source pero no la opción tableColumn, el comando genera las columnas automáticamente. En este caso, rangeObj debe ser un rango de celdas. De lo contrario, se utilizará la primera celda del rango. Cuando se generan columnas automáticamente, se aplican las siguientes reglas:
- Si los datos pasados al comando son una colección de objetos, los nombres de las propiedades se utilizan como títulos de las columnas. Por ejemplo:
([{ LastName: \"Freehafer\", FirstName: \"Nancy\"},{ LastName: \"John\", FirstName: \"Doe\"})
Aquí los títulos de las columnas serían LastName
y FirstName
.
Si los datos pasados al comando son una colección de valores escalares, deben contener una colección de subcolecciones:
- La colección de primer nivel contiene subcolecciones de valores. Cada subcolección define una línea. Pasa una colección vacía para saltar una línea. El número de valores de la primera subcolección determina cuántas columnas se crean.
- Los índices de las subcolecciones se utilizan como títulos de las columnas.
- Cada subcolección define los valores de las celdas para la línea. Los valores pueden ser
Integer
,Real
,Boolean
,Text
,Date
,Null
,Time
oPicture
. Un valorTime
debe ser un objeto que contenga un atributo time, tal y como se describe en VP SET VALUE.
Esto sólo funciona cuando se generan columnas automáticamente. No puede utilizar una colección de datos escalares con la opción tableColumns.
Ejemplo
Para crear una tabla utilizando un contexto de datos:
// Define un contexto de datos
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)
// Define las columnas de la tabla
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"))
// Crea una tabla de la colección "people"
VP CREATE TABLE(VP Cells("ViewProArea"; 1; 1; $options.tableColumns.length; 1); "ContextTable"; "people"; $options)
Aquí está el resultado:
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
El comando VP DELETE COLUMNS
elimina las columnas del rangeObj.
En rangeObj, pase un objeto que contenga un rango de columnas a eliminar. Si el rango pasado contiene:
- de las columnas y de las líneas, sólo se eliminan las columnas.
- únicamente las líneas, el comando no hace nada.
> Columns are deleted from right to left.
Ejemplo
Para eliminar las columnas seleccionadas por el usuario (en la imagen de abajo las columnas B, C y D):
utilice el siguiente código:
VP DELETE COLUMNS(VP Get selection("ViewProArea"))
Ver también
VP DELETE ROWS
VP DELETE ROWS ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
El comando VP DELETE ROWS
elimina las filas del rangeObj.
En rangeObj, pase un objeto que contenga un rango de líneas a eliminar. Si el rango pasado contiene:
- tanto las columnas como las líneas, sólo se eliminan las líneas.
- sólo columnas, el comando no hace nada.
> Rows are deleted from bottom to top.
Ejemplo
Para eliminar las líneas seleccionadas por el usuario (en la imagen de abajo las líneas 1, 2 y 3):
utilice el siguiente código:
VP DELETE ROWS(VP Get selection("ViewProArea"))
Ver también
E
VP EXPORT DOCUMENT
Historia
Versión | Modificaciones |
---|---|
v20 R2 | Soporte de documentos .sjs |
VP EXPORT DOCUMENT ( vpAreaName : Text ; filePath : Text {; paramObj : Object} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
filePath | Text | -> | Ruta de acceso del documento | |
paramObj | Object | -> | Opciones de exportación |
Descripción
El comando VP EXPORT DOCUMENT
exporta el objeto de 4D View Pro adjunto al área 4D View Pro vpAreaName a un documento en disco según los parámetros filePath y paramObj.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En filePath, pase la ruta de destino y el nombre del documento a exportar. Si no especifica una ruta, el documento se guardará en el mismo nivel que la carpeta Project.
Puede especificar el formato del archivo exportado incluyendo una extensión después del nombre del documento:
- 4D View Pro (".4vp")
- Microsoft Excel (".xlsx")
- PDF (".pdf")
- CSV (".txt", o ".csv")
- Documento SpreadJS (".sjs")
Si no se incluye la extensión, pero se especifica el formato en paramObj, el archivo exportado tendrá la extensión que corresponda al formato, excepto para el formato CSV (en este caso no se añade ninguna extensión).
El parámetro opcional paramObj le permite definir múltiples propiedades para el objeto 4D View Pro exportado y lanzar un método de retrollamada cuando la exportación haya finalizado.
Propiedad | Tipo | Descripción | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format | text | (opcional) Cuando está presente, designa el formato del archivo exportado: ".4vp" (por defecto), ".csv", ".xlsx", ".pdf" o ".sjs". Puede utilizar las siguientes constantesvk 4D View Pro format``vk</li><li> csv format``vk</li><li> MS Excel format``vk</li><li> pdf format``vk</li><li> sjs format | |||||||||||||||||||||||||||
contraseña | text | Sólo Microsoft Excel (opcional) - Contraseña utilizada para proteger el documento MS Excel | |||||||||||||||||||||||||||
formula | 4D.Function | Método de retrollamada que se lanzará cuando la exportación haya finalizado. La utilización de un método de retrollamada es necesaria cuando la exportación es asíncrona (que es el caso de los formatos PDF y Excel) si necesita que se ejecute algún código después de la exportación. El método retrollamada debe pasarse con el comando Formula . Ver Pasar un método de retrollamada (fórmula). | |||||||||||||||||||||||||||
valuesOnly | boolean | Especifica que sólo los valores de las fórmulas (si las hay) serán exportados. | |||||||||||||||||||||||||||
includeFormatInfo | boolean | True para incluir información de formato, false en caso contrario (por defecto es True). La información de formato es útil en algunos casos, por ejemplo, para una exportación a SVG. Por otro lado, poner esta propiedad en false permite reducir el tiempo de exportación. | |||||||||||||||||||||||||||
includeBindingSource | boolean | Sólo 4DVP y Microsoft Excel. True (por defecto) para exportar los valores del contexto de datos actual como valores de celda en el documento exportado (los contextos de datos en sí no se exportan). False en caso contrario. El enlace de la celda siempre se exporta. Para la gestión del contexto de datos y del enlace celular, ver VP SET DATA CONTEXT y VP SET BINDING PATH. | |||||||||||||||||||||||||||
sheet | number | PDF únicamente (opcional) - Índice de la hoja a exportar (empezando por 0). -2=todas las hojas visibles (por defecto), -1=sólo la hoja actual | |||||||||||||||||||||||||||
pdfOptions | object | Sólo PDF (opcional) - Opciones para la exportación de pdf
| |||||||||||||||||||||||||||
csvOptions | object | Sólo CSV (opcional) - Opciones para la exportación csv
| |||||||||||||||||||||||||||
sjsOptions | object | SJS only (optional) - Options for sjs export
| |||||||||||||||||||||||||||
customProperty | any | Toda propiedad personalizada que estará disponible a través del parámetro $3 en el método de retrollamada. |
Notas sobre el formato Excel:
- Al exportar un documento 4D View Pro a un archivo con formato Microsoft Excel, pueden perderse algunos parámetros. Por ejemplo, los métodos y fórmulas 4D no son soportados por 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.
Notas sobre el formato PDF:
- Al exportar un documento 4D View Pro en PDF, las fuentes utilizadas en el documento se integran automáticamente en el archivo PDF. Sólo se pueden integrar las fuentes OpenType (archivos .OTF o .TTF) que tengan un tabla Unicode. Si no se encuentra un archivo de fuentes válido para una fuente, se utiliza una fuente por defecto.
- Exporting in this format is run asynchronously, use the
formula
property of the paramObj for code to be executed after the export.
Notas sobre el formato CSV:
- Al exportar un documento 4D View Pro al formato CSV, es posible que se pierdan algunos parámetros, ya que sólo se guardan el texto y los valores.
- Todos los valores se guardan como cadenas entre comillas. 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.
Notas sobre el formato de archivo SpreadJS:
- 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.
Pasar un método retrollamada (fórmula)
Cuando se incluye el parámetro opcional paramObj, el comando le permite utilizar el comando Formula
para llamar a un método 4D que se ejecutará una vez finalizada la exportación. El método de retrollamada recibirá los siguientes valores en parámetros locales:
Parámetros | Tipo | Descripción | |
---|---|---|---|
param1 | text | El nombre del objeto de área 4D View Pro | |
param2 | text | Ruta de acceso del objeto 4D View Pro exportado | |
param3 | object | Una referencia al paramObj del comando | |
param4 | object | Un objeto devuelto por el método con un mensaje de estado | |
.success | boolean | True si exporta con éxito, de lo contrario False. | |
.errorCode | integer | Código de error. | |
.errorMessage | text | Mensaje de error. |
Ejemplo 1
Quiere exportar el contenido del área "VPArea" a un documento 4D View Pro en el disco:
var $docPath: Text
$docPath:="C:\\Bases\\ViewProDocs\\MyExport.4VP"
VP EXPORT DOCUMENT("VPArea";$docPath)
//MyExport.4VP se guarda en su disco
Ejemplo 2
Quiere exportar la hoja actual en 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)
Ejemplo 3
Desea exportar un documento 4D View Pro en formato ".xlsx" y llamar a un método que inicie Microsoft Excel con el documento abierto una vez completada la exportación:
$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)
Método AfterExport:
#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
Ejemplo 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))
Aquí está el resultado:
Ver también
VP Convert to picture
VP Export to object
VP Column
VP Print
VP EXPORT TO BLOB
VP EXPORT TO BLOB ( vpAreaName : Text ; paramObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
paramObj | Object | -> | Opciones de exportación |
Descripción
El comando VP EXPORT TO BLOB
exporta el documento 4D View Pro vpAreaName en un 4D.Blob según las opciones paramObj. El blob exportado está disponible a través de la retrollamada de exportación. Exportar e importar áreas de 4D View Pro como blogs es rápido y eficiente en memoria.
En paramObj, puede pasar varias propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
formula | 4D.Function | (obligatorio) Método de retrollamada que se lanzará cuando la exportación haya finalizado. Ver Pasar un método de retrollamada (fórmula). |
includeAutoMergedCells | Boolean | Si se incluyen las celdas combinadas automáticamente al guardar, por defecto=false. |
includeBindingSource | Boolean | Si incluir la fuente de vinculación al guardar, por defecto=true. |
includeCalcModelCache | Boolean | Si desea incluir los datos adicionales de cálculo. Puede afectar a la velocidad de apertura del archivo, por defecto=false. |
includeEmptyRegionCells | Boolean | Si se incluyen celdas vacías (celdas sin datos o sólo con estilo) fuera del rango de datos utilizado, por defecto=true |
includeFormulas | Boolean | Si se incluye la fórmula al guardar, por defecto=true. |
includeStyles | Boolean | Si se incluye el estilo al guardar, por defecto=true. |
includeUnusedNames | Boolean | Si se incluye el nombre personalizado no utilizado al guardar, por defecto=true. |
|saveAsView|Boolean|Si aplicar la cadena de formato al valor exportado al guardar, por defecto=false.|
Los siguientes parámetros se pueden utilizar en el método de retrollamada:
Parámetros | Tipo | Descripción | |
---|---|---|---|
param1 | text | El nombre del objeto 4D View Pro | |
param2 | 4D.blob | El blob exportado | |
param3 | object | Referencia al parámetro paramObj del comando | |
param4 | object | Un objeto devuelto por el método con un mensaje de estado | |
.success | boolean | True si exporta con éxito, de lo contrario False. | |
.errorCode | integer | Código de error. | |
.errorMessage | text | Mensaje de error. |
Ejemplo
El comando VP EXPORT TO BLOB
es asíncrono. Debe crear un método de retrollamada (llamado VPBlobCallback en nuestro ejemplo) para utilizar los resultados de la exportación.
//Exportar el documento VP
VP EXPORT TO BLOB("ViewProArea"; {formula: Formula(VPBlobCallback)})
//Método VPBlobCallback
#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
Ver también
VP Export to object
VP Export to object ( vpAreaName : Text {; options : Object} ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
options | Object | -> | Opciones de exportación | |
Result | Object | <- | Objeto 4D View Pro |
Descripción
El comando VP Export to object
devuelve el objeto 4D View Pro adjunto al área 4D View Pro vpAreaName. Puede utilizar este comando, por ejemplo, para almacenar el área 4D View Pro en un campo objeto de la base de datos 4D.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro options, puede pasar las siguientes opciones de exportación, si es necesario:
Propiedad | Tipo | Descripción |
---|---|---|
includeFormatInfo | Boolean | True (por defecto) para incluir la información del formato, en caso contrario false. La información de formato es útil en algunos casos, por ejemplo, para una exportación a SVG. Por otro lado, poner esta propiedad en False permite reducir el tiempo de exportación. |
includeBindingSource | Boolean | True (por defecto) para exportar los valores del contexto de datos actual como valores de celda en el objeto exportado (los contextos de datos en sí no se exportan). False en caso contrario. El enlace de la celda siempre se exporta. |
Para más información sobre los objetos 4D View Pro, consulte el párrafo Objeto 4D View Pro.
Ejemplo 1
Quiere obtener la propiedad "version" del área 4D View Pro actual:
var $vpAreaObj : Object
var $vpVersion : Number
$vpAreaObj:=VP Export to object("vpArea")
// $vpVersion:=OB Get($vpAreaObj;"version")
$vpVersion:=$vpAreaObj.version
Ejemplo 2
Desea exportar el área, excluyendo la información de formato:
var $vpObj : Object
$vpObj:=VP Export to object("vpArea";New object("includeFormatInfo";False))
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
searchValue | Text | -> | Valor de búsqueda | |
searchCondition | Object | -> | Objeto que contiene la(s) condición(es) de búsqueda | |
replaceValue | Text | -> | Valor de reemplazo | |
Result | Object | <- | Objeto rango |
Descripción
El comando VP Find
busca en el rangeObj el searchValue. Se pueden utilizar parámetros opcionales para afinar la búsqueda y/o sustituir los resultados encontrados.
En el parámetro rangeObj, pase un objeto que contenga un rango a buscar.
El parámetro searchValue permite pasar el texto a buscar dentro del rangeObj.
Puede pasar el parámetro opcional searchCondition para especificar el funcionamiento de la búsqueda. Se soportan las siguientes propiedades:
Propiedad | Tipo | Descripción | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
afterColumn | Integer | El número de la columna justo antes de la columna inicial de la búsqueda. If the rangeObj is a combined range, the column number given must be from the first range. Valor por defecto: -1 (inicio de rangeObj) | ||||||||
afterRow | Integer | El número de la línea justo antes de la línea inicial de la búsqueda. If the rangeObj is a combined range, the row number given must be from the first range. Valor por defecto: -1 (inicio de 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: |
En el parámetro opcional replaceValue, puede pasar un texto para que ocupe el lugar de toda instancia del texto en el searchValue encontrado en rangeObj.
Objeto devuelto
La función devuelve un objeto de rango que describe cada valor de búsqueda encontrado o reemplazado. Se devuelve un objeto de rango vacío si no se encuentran resultados.
Ejemplo 1
Para encontrar la primera celda que contenga la palabra "Total":
var $range;$result : Object
$range:=VP All("ViewProArea")
$result:=VP Find($range;"Total")
Ejemplo 2
Para encontrar "Total" y reemplazarlo por "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
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP Find table ( rangeObj : Object ) : Text
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Rango de celdas | |
Result | Text | <- | Nombre de la tabla |
Descripción
El comando VP Find table
devuelve el nombre de la tabla a la que pertenece la celda rangeObj.
En rangeObj, pase un objeto de rango de celdas. Si las celdas designadas no pertenecen a una tabla, el comando devuelve una cadena vacía.
Si rangeObj no es un rango de celdas o contiene varios rangos, se utiliza la primera celda del primer rango.
Ejemplo
If (FORM Event.code=On After Edit && FORM Event.action="valueChanged")
$tableName:=VP Find table(FORM Event.range)
If ($tableName#"")
ALERT("La tabla "+$tableName+" ha sido modificada.")
End if
End if
Ver también
VP FLUSH COMMANDS
VP FLUSH COMMANDS ( vpAreaName : Text )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
Descripción
El comando VP FLUSH COMMANDS
ejecuta inmediatamente los comandos almacenados y borra el buffer de comandos.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Para aumentar el rendimiento y reducir el número de peticiones enviadas, los comandos 4D View Pro llamados por el desarrollador se almacenan en un buffer de comandos. Cuando se llama, VP FLUSH COMMANDS
ejecuta los comandos como un lote al salir del método y vacía el contenido del buffer de comandos.
Ejemplo
Quiere rastrear la ejecución de los comandos y vaciar el 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
Parámetros | Tipo | Descripción | |
---|---|---|---|
font | Text | -> | Cadena abreviada para la fuente |
Result | Object | <- | Objeto fuente |
Descripción
El comando utilitario VP Font to object
devuelve un objeto a partir de una cadena abreviada de fuentes. Este objeto se puede utilizar para establecer u obtener la configuración de las propiedades de la fuente a través de la notación de objetos.
En el parámetro font, pase una cadena de fuente abreviada para especificar las diferentes propiedades de una fuente (por ejemplo, "12 pt Arial"). Puede obtener más información sobre las cadenas abreviadas de fuentes en esta página, por ejemplo.
El objeto devuelto contiene los atributos de fuente definidos como propiedades. Para obtener más información sobre las propiedades disponibles, consulte el comando VP Object to font.
Ejemplo 1
Este código:
$font:=VP Font to object("16pt arial")
devolverá el objeto $font:
{
family:arial
size:16pt
}
Ejemplo 2
Ver el ejemplo de VP Object to to font
.
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto rango de una sola celda |
Descripción
El comando VP Get active cell
devuelve un nuevo objeto de rango que hace referencia a la celda que tiene el foco y en la que se introducirán los nuevos datos (la celda activa).
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
El siguiente código recuperará las coordenadas de la celda activa:
$activeCell:=VP Get active cell("myVPArea")
//devuelve un objeto rango que contiene:
//$activeCell.ranges[0].column=3
//$activeCell.ranges[0].row=4
//$activeCell.ranges[0].sheet=0
Ver también
VP ADD SELECTION
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP Get binding path
Historia
Versión | Modificaciones |
---|---|
v19 R5 | Añadidos |
VP Get binding path ( rangeObj : Object ) : Text
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Text | <- | Nombre del atributo vinculado a la celda |
Descripción
El comando VP Get binding path
devuelve el nombre del atributo ligado a la celda especificada en rangeObj.
En rangeObj, pase un objeto que es un rango de celdas o un rango combinado de celdas. Note que:
- Si rangeObj es un rango de varias celdas, el comando devuelve el nombre del atributo asociado a la primera celda del rango.
- Si rangeObj contiene varios rangos de celdas, el comando devuelve el nombre del atributo asociado a la primera celda del primer rango.
Ejemplo
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"
Ver también
VP SET BINDING PATH
VP Get data context
VP SET DATA CONTEXT
VP Get cell style
VP Get cell style ( rangeObj : Object ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Object | <- | Objeto style |
Descripción
El comando VP Get cell style
devuelve un objeto estilo para la primera celda del rangeObj.
En rangeObj, pase un rango que contenga el estilo a recuperar.
- Si rangeObj contiene un rango de celdas, se devuelve el estilo de la celda.
- Si rangeObj contiene un rango que no es un rango de celdas, se devuelve el estilo de la primera celda del rango.
- Si rangeObj contiene varios rangos, sólo se devuelve el estilo de la primera celda del primer rango.
Ejemplo
Para obtener los detalles sobre el estilo en la celda seleccionada (B2):
Este código:
$cellStyle:=VP Get cell style(VP Get selection("myDoc"))
... devolverá este objeto:
{
"backColor":"Azure",
"borderBottom":
{
"color":#800080,
"style":5
}
"font":"8pt Arial",
"foreColor":"red",
"hAlign":1,
"isVerticalText":"true",
"vAlign":0
}
Ver también
VP GET DEFAULT STYLE
VP SET CELL STYLE
VP Get column attributes
VP Get column attributes ( rangeObj : Object ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Collection | <- | Colección de propiedades de columnas |
Descripción
El comando VP Get column attributes
devuelve una colección de propiedades para toda columna del rangeObj.
En rangeObj, pase un objeto que contenga un rango de columnas cuyos atributos serán recuperados.
La colección devuelta contiene todas las propiedades de las columnas, hayan sido o no definidas por el comando VP SET COLUMN ATTRIBUTES.
Ejemplo
El código siguiente:
C_OBJECT($range)
C_COLLECTION($attr)
$range:=VP Column("ViewProArea";1;2)
$attr:=VP Get column attributes($range)
... devolverá una colección de los atributos dentro del rango dado:
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro en el formulario | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Integer | <- | Número total de columnas |
Descripción
El comando VP Get column count
devuelve el número total de columnas de la sheet designada.
En vpAreaName, pase el nombre de la propiedad del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Puede definir dónde obtener el número de columnas en el parámetro opcional sheet utilizando el índice de la hoja (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
El siguiente código devuelve el número de columnas en el área 4D View Pro:
C_INTEGER($colCount)
$colCount:=VP Get column count("ViewProarea")
Ver también
VP Get row count
VP SET COLUMN COUNT
VP SET ROW COUNT
VP Get current sheet
VP Get current sheet ( vpAreaName : Text )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
Resultado | Integer | <- | Indice de la hoja actual |
Descripción
El comando VP Get current sheet
devuelve el índice de la hoja actual en vpAreaName. La hoja actual es la hoja seleccionada en el documento.
En vpAreaName, pase el nombre del área 4D View Pro.
La indexación comienza en 0.
Ejemplo
Cuando se selecciona la tercera hoja:
El comando devuelve 2:
$index:=VP Get current sheet("ViewProArea")
Ver también
VP Get data context
Historia
Versión | Modificaciones |
---|---|
v19 R5 | Añadidos |
VP Get data context ( vpAreaName : Text {; sheet : Integer } ) : Object
VP Get data context ( vpAreaName : Text {; sheet : Integer } ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja para obtener el contexto de datos | |
Result | Object | Collection | <- | Contexto de datos |
Descripción
El comando VP Get data context
devuelve el contexto de datos actual de una hoja de cálculo. El contexto devuelto incluye toda modificación realizada en el contenido del contexto de datos.
En sheet, pase el índice de la hoja de la que obtener el contexto de datos. Si no se pasa ningún índice, el comando devuelve el contexto de datos de la hoja de cálculo actual. Si no hay contexto para la hoja de trabajo, el comando devuelve Null
.
La función devuelve un objeto o una colección dependiendo del tipo de contexto de datos establecido con VP SET DATA CONTEXT.
Ejemplo
Para obtener el contexto de datos asociado a las siguientes celdas:
var $dataContext : Object
$dataContext:=VP Get data context("ViewProArea") // {firstName:Freehafer,lastName:Nancy}
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro en el formulario | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Parámetros de estilo por defecto |
Descripción
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.
En vpAreaName, pase el nombre de la propiedad del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Puede definir dónde obtener el número de columnas en el parámetro opcional sheet utilizando el índice de la hoja (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
Para obtener los detalles sobre el estilo predeterminado para este documento:
Este código:
$defaultStyle:=VP Get default style("myDoc")
devolverá esta información en el objeto $defaultStyle:
{
backColor:#E6E6FA,
hAlign:0,
vAlign:0,
font:12pt papyrus
}
Ver también
VP Get cell style
VP SET DEFAULT STYLE
VP Get formula
VP Get formula ( rangeObj : Object) : Text
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Text | <- | Formula |
Descripción
El comando VP Get formula
recupera la fórmula de un rango de celdas designado.
En rangeObj, pase un rango cuya fórmula desea recuperar. Si rangeObj designa varias celdas o varios rangos, se devuelve la fórmula de la primera celda. Si rangeObj es una celda que no contiene una fórmula, el método devuelve una cadena vacía.
Ejemplo
//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)"
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
name | Text | -> | Nombre del rango nombrado | |
scope | Number | -> | Alcance objetivo (por defecto=hoja actual) | |
Result | Object | <- | Definición de la fórmula o rango con nombre |
Descripción
El comando VP Get formula by name
devuelve la fórmula y el comentario correspondientes al rango con nombre o a la fórmula con nombre pasada en el parámetro name, o null si no existe en el ámbito definido.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Pase el rango con nombre o la fórmula con nombre que desea obtener en name. Tenga en cuenta que los rangos con nombre se devuelven como fórmulas que contienen referencias absolutas de celdas.
Puede definir dónde obtener la fórmula en scope utilizando el índice de la hoja (la numeración comienza en 0) o una de las siguientes constantes:
vk current sheet
vk workbook
Objeto devuelto
El objeto devuelto contiene las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
formula | Text | Texto de la fórmula correspondiente a la fórmula nombrada o al rango nombrado. Para los rangos nombrados, la fórmula es una secuencia de coordenadas absolutas. |
comment | Text | Comentario correspondiente a la fórmula nombrada o al rango nombrado |
Ejemplo
$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)
Ver también
VP ADD FORMULA NAME
VP Get names
VP Get formulas
VP Get formulas ( rangeObj : Object ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Collection | <- | Colección de valores de una fórmula |
Descripción
El comando VP Get formulas
recupera las fórmulas de un rangeObj designado.
En rangeObj, pase un rango cuyas fórmulas desea recuperar. Si rangeObj designa varios rangos, se devuelve la fórmula del primer rango. Si rangeObj no contiene fórmulas, el comando devuelve una cadena vacía.
La colección devuelta es bidimensional:
- La colección de primer nivel contiene subcolecciones de fórmulas. Cada subcolección representa una línea.
- Cada subcolección define los valores de las celdas para la línea. The first-level collection contains subcollections of formulas.
Ejemplo
Quiere recuperar las fórmulas de las columnas Sum y Average de este documento:
Puede utilizar este código:
$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)]
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto que contiene la información de las columnas y líneas congeladas |
Descripción
El comando VP Get frozen panes
devuelve un objeto con información sobre las columnas y filas congeladas en vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Objeto devuelto
El comando devuelve un objeto que describe las columnas y líneas congeladas. Este objeto puede contener las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
columnCount | Integer | El número de columnas congeladas a la izquierda de la hoja |
trailingColumnCount | Integer | El número de columnas congeladas a la derecha de la hoja |
rowCount | Integer | El número de líneas congeladas en la parte superior de la hoja |
trailingRowCount | Integer | El número de líneas congeladas en la parte inferior de la hoja |
Ejemplo
Quiere recuperar información sobre el número de columnas y líneas congeladas:
var $panesObj : Object
$panesObj:=VP Get frozen panes("ViewProArea")
El objeto devuelto contiene, por ejemplo:
Ver también
VP Get names
VP Get names ( vpAreaName : Text { ; scope : Number } ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
scope | Number | -> | Alcance objetivo (por defecto= hoja actual) | |
Result | Collection | <- | Nombres existentes en el alcance definido |
Descripción
El comando VP Get names
devuelve una colección de todos los "nombres" definidos en la hoja actual o en el ámbito designado por el parámetro scope.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Puede definir dónde obtener los nombres en scope utilizando el índice de la hoja (la numeración comienza en 0) o una de las siguientes constantes:
vk current sheet
vk workbook
Colección devuelta
La colección devuelta contiene un objeto por nombre. Las propiedades de objetos siguientes pueden ser devueltas:
Propiedad | Tipo | Descripción |
---|---|---|
result[ ].name | Text | nombre de celda o de rango |
result[ ].formula | Text | formula |
result[ ].comment | Text | Comentario asociado al nombre |
Las propiedades disponibles dependen del tipo de elemento con nombre (celda con nombre, rango con nombre o fórmula con nombre).
Ejemplo
var $list : Collection
$list:=VP Get names("ViewProArea";2) //nombres en la 3a hoja
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto que contiene la información de impresión |
Descripción
El comando VP Get print info
devuelve un objeto que contiene los atributos de impresión del vpAreaName.
Pase el nombre del área de 4D View Pro en vpAreaName. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja de cálculo específica (la numeración comienza en 0) cuyos atributos de impresión desea devolver. Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
Este código:
$pinfo:=VP Get print info("ViewProArea")
... devuelve los atributos de impresión del área de 4D View Pro definida en el comando VP SET PRINT INFO:
{
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
}
Ver también
4D View Pro Print Attributes
VP SET PRINT INFO
VP Get row attributes
VP Get row attributes ( rangeObj : Object ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Collection | <- | Colección de propiedades de la línea |
Descripción
El comando VP Get row attributes
devuelve una colección de propiedades para cualquier fila del rangeObj.
En rangeObj, pase un objeto que contenga un rango de líneas cuyos atributos serán recuperados.
La colección devuelta contiene las propiedades de las filas, hayan sido o no definidas por el método VP SET ROW ATTRIBUTES.
Ejemplo
El siguiente código devuelve una colección de los atributos dentro del rango dado:
var $range : Object
var $attr : Collection
$range:=VP Column("ViewProArea";1;2)
$attr:=VP Get row attributes($range)
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro en el formulario | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Integer | <- | Número total de líneas |
Descripción
El comando VP Get row count
devuelve el número total de filas de la sheet designada.
En vpAreaName, pase el nombre de la propiedad del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Puede definir dónde obtener el número de líneas en el parámetro opcional sheet utilizando el índice de la hoja (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
El siguiente código devuelve el número de líneas en el área 4D View Pro:
var $rowCount : Integer
$rowCount:=VP Get row count("ViewProarea")
Ver también
VP Get column count
VP SET COLUMN COUNT
VP SET ROW COUNT
VP Get selection
VP Get selection ( vpAreaName : Text {; sheet : Integer } ) ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro en el formulario | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto rango de celdas |
Descripción
El comando VP Get selection
devuelve un nuevo objeto de rango que hace referencia a las celdas seleccionadas actualmente.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Ejemplo
El siguiente código recuperará las coordenadas de todas las celdas de la selección actual:
$currentSelection:=VP Get selection("myVPArea")
//devuelve un objeto rango que contiene:
//$currentSelection.ranges[0].column=5
//$currentSelection.ranges[0].columnCount=2
//$currentSelection.ranges[0].row=8
//$currentSelection.ranges[0].rowCount=6
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
Resultado | Integer | <- | Número de hojas |
Descripción
El comando VP Get sheet count
devuelve el número de hojas del documento cargado en vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
Ejemplo
En el siguiente documento:
Obtener el número de hojas y define la hoja actual como la última hoja:
$count:=VP Get sheet count("ViewProArea")
//definir la hoja actual como la última hoja (la indexación comienza en 0)
VP SET CURRENT SHEET("ViewProArea";$count-1)
Ver también
VP Get sheet index
VP SET SHEET COUNT
VP Get sheet index
VP Get sheet index ( vpAreaName : Text ; name : Text ) : Integer
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
name | Text | -> | Nombre de la hoja | |
Resultado | Integer | <- | Índice de la hoja |
Descripción
El comando VP Get sheet index
devuelve el índice de una hoja basándose en su nombre en vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
En name, pase el nombre de la hoja cuyo índice se devolverá. Si no se encuentra ninguna hoja llamada name en el documento, el método devuelve -1.
La indexación comienza en 0.
Ejemplo
En el siguiente documento:
Obtiene el índice de la hoja llamada "Total first quarter":
$index:=VP Get sheet index("ViewProArea";"Total premier trimestre") //devuelve 2
Ver también
VP Get sheet count
VP Get sheet name
VP Get sheet name
VP Get sheet name ( vpAreaName : Text ; sheet : Integer ) : Text
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja | |
Resultado | Text | <- | Nombre de la hoja |
Descripción
El comando VP Get sheet name
devuelve el nombre de una hoja en función de su índice en vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, pase el índice de la hoja cuyo nombre se devolverá.
Si el índice de hoja pasado no existe, el método devuelve un nombre vacío.
La indexación comienza en 0.
Ejemplo
Obtener el nombre de la tercera hoja en el documento:
$sheetName:=VP Get sheet name("ViewProArea";2)
Ver también
VP Get sheet options
VP Get sheet options ( vpAreaName : Text {; sheet : Integer } ) ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro en el formulario | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto opciones de la hoja |
Descripción
El comando VP Get sheet options
devuelve un objeto que contiene las opciones de hoja actuales del área vpAreaName.
Pase el nombre del área de 4D View Pro en vpAreaName. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica (la numeración comienza en 0). Si se omite o si se pasa vk current sheet
, se utiliza la hoja de cálculo actual.
Objeto devuelto
El método devuelve un objeto que contiene los valores actuales de todas las opciones de hoja disponibles. Un valor de opción puede haber sido modificado por el usuario o por el método VP SET SHEET OPTIONS.
Para ver la lista completa de las opciones, consulte Opciones de hoja.
Ejemplo
$options:=VP Get sheet options("ViewProArea")
If($options.colHeaderVisible) //los encabezados de las columnas son visibles
... //do something
End if
Ver también
4D VIEW PRO SHEET OPTIONS
VP SET SHEET OPTIONS
VP Get show print lines
VP Get show print lines ( vpAreaName : Text {; sheet : Integer } ) : Boolean
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | <- | Índice de la hoja | |
Resultado | Boolean | <- | True si las líneas de impresión son visibles, de lo contrario False |
Descripción
The VP Get show print lines
command returns True
if the print preview lines are visible and False
if they are hidden.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, pase el índice de la hoja objetivo. If sheet is omitted, the command applies to the current sheet.
La indexación comienza en 0.
Ejemplo
El siguiente código comprueba si las líneas de vista previa se muestran u ocultan en el documento:
var $result : Boolean
$result:=VP Get show print lines("ViewProArea";1)
Ver también
VP Get spans
VP Get spans ( rangeObj : Object ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Object | <- | Objeto de celdas fusionadas en el rango definido |
Descripción
The VP Get spans
command retrieves the cell spans in the designated rangeObj.
En rangeObj, pase un rango de celdas fusionadas que desee recuperar. Si rangeObj no contiene celdas fusionadas, se devuelve un rango vacío.
Ejemplo
Para centrar el texto de las celdas fusionadas en este documento:
// 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)
Ver también
VP Get stylesheet
VP Get stylesheet ( vpAreaName : Text ; styleName : Text { ; sheet : Integer } ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
styleName | Text | -> | Nombre del estilo | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Objeto hoja de estilo |
Descripción
The VP Get stylesheet
command returns the styleName style sheet object containing the property values which have been defined.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En styleName, pase el nombre de la hoja de estilo a obtener.
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
Ejemplo
El código siguiente:
$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}
}
Ver también
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
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Alcance objetivo (por defecto = hoja actual) | |
Result | Collection | <- | Colección de objetos de hojas de estilo |
Descripción
The VP Get stylesheets
command returns the collection of defined style sheet objects from the designated sheet.
En vpAreaName, pase el nombre de la propiedad del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
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
Ejemplo
El siguiente código devolverá una colección de todos los objetos estilo de la hoja actual:
$styles:=VP Get stylesheets("ViewProArea")
En este caso, la hoja actual utiliza dos objetos estilo:
[
{
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
}
]
Ver también
VP ADD STYLESHEET
VP Get stylesheet
VP REMOVE STYLESHEET
VP Get table column attributes
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP Get table column attributes ( vpAreaName : Text ; tableName : Text ; column : Integer {; sheet : Integer } ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
column | Integer | -> | Índice de la columna en la tabla | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Atributos de la columna |
Descripción
The VP Get table column attributes
command returns the current attributes of the specified column in the tableName.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice o si pasa -1, el comando se aplica a la hoja actual.
La indexación comienza en 0.
The command returns an object describing the current attributes of the column:
Propiedad | Tipo | Descripción |
---|---|---|
dataField | text | Nombre de la propiedad de la columna de la tabla en el contexto de datos. No se devuelve si la tabla se muestra automáticamente |
name | text | Nombre de la columna de la tabla. |
footerText | text | Valor del pie de columna. |
footerFormula | text | Fórmula del pie de columna. |
filterButtonVisible | boolean | True si se muestra el botón de filtro de la columna de la tabla, False en caso contrario. |
If tableName is not found or if column index is higher than the number of columns, the command returns null.
Ejemplo
var $attributes : Object
$attributes:=VP Get table column attributes("ViewProArea"; $tableName; 1)
If ($attributes.dataField#"")
...
End if
Ver también
VP CREATE TABLE
VP Find table
VP SET TABLE COLUMN ATTRIBUTES
VP RESIZE TABLE
VP Get table column index
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP Get table column index ( vpAreaName : Text ; tableName : Text ; columnName : Text {; sheet : Integer } ) : Integer
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
columnName | Text | -> | Nombre de la columna de la tabla | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Integer | <- | Índice de columnName |
Descripción
The VP Get table column index
command returns the index of the columnName in the tableName.
En vpAreaName, pase el nombre del área 4D View Pro.
In columnName, pass the name of the table column for which you want to get the index.
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice o si pasa -1, el comando se aplica a la hoja actual.
La indexación comienza en 0.
Si no se encuentra tableName o columnName, el comando devuelve -1.
Ejemplo
// 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)
Ver también
VP CREATE TABLE
VP Find table
VP Get table column attributes
VP SET TABLE COLUMN ATTRIBUTES
VP Get table dirty rows
Historia
Versión | Modificaciones |
---|---|
v19 R8 | Añadidos |
VP Get table dirty rows ( vpAreaName : Text ; tableName : Text { ; reset : Boolean {; sheet : Integer }} ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
reset | Boolean | -> | True para borrar el estado sucio de la tabla actual, False para mantenerlo intacto. Por defecto=True | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Collection | <- | Collection of objects with all the items modified since the last reset |
Descripción
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.
En vpAreaName, pase el nombre del área 4D View Pro.
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.
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice o si pasa -1, el comando se aplica a la hoja actual.
La indexación comienza en 0.
Each dirty row object in the returned collection contains the following properties:
Propiedad | Tipo | Descripción |
---|---|---|
item | object | Objeto modificado de la línea modificada |
originalItem | object | Objeto antes de la modificación |
row | integer | Índice de la línea modificada |
If tableName is not found or if it does not contain a modified column, the command returns an empty collection.
Ejemplo
Desea contar el número de lineas editadas:
var $dirty : Collection
$dirty:=VP Get table dirty rows("ViewProArea"; "ContextTable"; False)
VP SET NUM VALUE(VP Cell("ViewProArea"; 0; 0); $dirty.length)
Ver también
VP CREATE TABLE
VP Find table
VP SET TABLE COLUMN ATTRIBUTES
VP RESIZE TABLE
VP Get table range
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP Get table range ( vpAreaName : Text ; tableName : Text {; onlyData : Integer {; sheet : Integer }} ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
onlyData | Integer | -> | vk table full range (default) or vk table data range | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Object | <- | Rango que contiene la tabla |
Descripción
The VP Get table range
command returns the range of tableName.
En vpAreaName, pase el nombre del área 4D View Pro.
In the onlyData parameter, you can pass one of the following constants to indicate if you want to get the data only:
Constante | Valor | Descripción |
---|---|---|
vk table full range | 0 | Obtiene el rango de celdas para el área de la tabla con pie de página y encabezado (por defecto si se omite) |
vk table data range | 1 | Obtener el rango de celdas sólo para el área de datos de la tabla |
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice, el comando se aplica a la hoja actual.
La indexación comienza en 0.
Si no se encuentra tableName, el comando devuelve null.
Ver también
VP Get table theme
Historia
Versión | Modificaciones |
---|---|
v19 R8 | Añadidos |
VP Get table theme ( vpAreaName : Text ; tableName : Text ) : cs.ViewPro.TableTheme
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
Result | cs.ViewPro.TableTheme | <- | Valores de propiedad del tema de la tabla actual |
Descripción
El comando VP Get table theme
devuelve los valores actuales de las propiedades del tema de la tabla tableName. El tema de una tabla puede establecerse mediante los comandos VP CREATE TABLE
o VP SET TABLE THEME
, o a través de la interfaz.
En* vpAreaName*, pase el nombre del área 4D View Pro y en tableName, el nombre de la tabla.
El comando devuelve un objeto de la clase cs.ViewPro.TableTheme con propiedades y valores que describen el tema actual de la tabla.
Ejemplo
El comando devuelve un objeto tema
completo incluso si se utilizó un nombre de tema nativo de SpreadJS para definir el tema.
var $param : cs.ViewPro.TableTheme
$param:=cs.ViewPro.TableTheme.new()
$param.theme:="dark10" //uso de un nombre de tema nativo
VP SET TABLE THEME("ViewProArea"; "ContextTable"; $param)
$vTheme:=VP Get table theme("ViewProArea"; "ContextTable")
$result:=Asserted(Value type($vTheme.theme)=Is object) //true
Ver también
VP CREATE TABLE
VP SET TABLE THEME
VP Get tables
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP Get tables ( vpAreaName : Text { ; sheet : Integer } ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) | |
Result | Collection | <- | Colección de textos con todos los nombres de las tablas |
Descripción
El comando VP Get tables
devuelve una colección de todos los nombres de tablas definidos en la hoja.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice, el comando se aplica a la hoja actual.
La indexación comienza en 0.
Ejemplo
El siguiente código devolverá una colección de todos los nombres de tablas de la hoja actual:
$tables:=VP Get tables("ViewProArea")
//$tables contains for example ["contextTable","emailTable"]
Ver también
VP Get value
VP Get value ( rangeObj : Object ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Object | <- | Objeto que contiene un valor de celda |
Descripción
The VP Get value
command retrieves a cell value from a designated cell range.
En rangeObj, pase un rango cuyo valor desea recuperar.
Objeto devuelto
The object returned will contain the value
property, and, in case of a js date value, a time
property:
Propiedad | Tipo | Descripción |
---|---|---|
value | Integer, Real, Boolean, Text, Date | Valor en el rangeObj (excepto- tiempo) |
time | Real | Valor hora (en segundos) si el valor es del tipo de fecha js |
Si el objeto devuelto incluye una fecha u hora, se trata como una fecha-hora y se completa de la siguiente manera:
- valor hora - la parte de la fecha se completa como December 30, 1899 en formato dd/MM/yyyy (30/12/1899)
- valor fecha - la parte de la hora se completa como medianoche en formato HH:mm:ss (00:00:00)
If rangeObj contains multiple cells or multiple ranges, the value of the first cell is returned. El comando devuelve un objeto null si la celda está vacía.
Ejemplo
$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
Ver también
VP Get values
VP SET VALUE
VP SET VALUES
VP Get values
VP Get values ( rangeObj : Object ) : Collection
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
Result | Collection | <- | Colección de valores |
Descripción
The VP Get values
command retrieves the values from the designated rangeObj.
En rangeObj, pase un rango cuyos valores desea recuperar. If rangeObj includes multiple ranges, only the first range is used.
The collection returned by VP Get values
contains a two-dimensional collection:
- Cada elemento de la colección de primer nivel representa una línea y contiene una subcolección de valores
- Cada subcolección contiene los valores de las celdas de la línea. Los valores pueden ser Integer, Real, Boolean, Text, Null. Si un valor es de tipo fecha u hora, se devuelve en un objeto con las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
value | Fecha | Valor de la celda (excepto - time) |
time | Real | Valor hora (en segundos) si el valor es del tipo de fecha js |
Las fechas o las horas son consideradas como un datetime y se completan de la siguiente manera:
- valor de tipo hora - la parte fecha se completa como 30 de diciembre de 1899
- valor de tipo date - la parte de la hora se completa como medianoche (00:00:00:000)
Ejemplo
Quiere obtener los valores de C4 a 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]
Ver también
VP Get formulas
VP Get value
VP SET FORMULAS
VP SET VALUES
VP Get workbook options
VP Get workbook options ( vpAreaName : Text ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
Result | Object | <- | Objeto que contiene las opciones del libro de trabajo |
Descripción
VP Get workbook options
returns an object containing all the workbook options in vpAreaName
En vpAreaName, pase el nombre del área 4D View Pro.
El objeto devuelto contiene todas las opciones del libro de trabajo (por defecto y modificadas), en el libro de trabajo.
The list of workbook options is referenced in VP SET WORKBOOK OPTIONS
's description.
Ejemplo
var $workbookOptions : Object
$workbookOptions:=VP Get workbook options("ViewProArea")
Ver también
I
VP IMPORT DOCUMENT
Historia
Versión | Modificaciones |
---|---|
v20 R2 | Soporte de documentos .sjs |
VP IMPORT DOCUMENT ( vpAreaName : Text ; filePath : Text { ; paramObj : Object} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
filePath | Text | -> | Ruta de acceso del documento | |
paramObj | Object | -> | Opciones de importación |
Descripción
The VP IMPORT DOCUMENT
command imports and displays the document designated by filePath in the 4D View Pro area vpAreaName. El documento importado sustituye a los datos ya insertados en el área.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
In filePath, pass the path and name of the document to be imported. Se soportan los siguientes formatos:
- Los documentos 4D View Pro (extensión ".4vp")
- Microsoft Excel (extensión ".xlsx")
- documentos texto (extension ".txt", ".csv", el documento debe estar 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. Debe pasar una ruta completa, a menos que el documento se encuentre en el mismo nivel que la carpeta Project, en cuyo caso puede pasar sólo su nombre.
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:
Parámetros | Tipo | Descripción | |
---|---|---|---|
formula | 4D.Function | Un método de retollamada que se lanzará cuando la importación haya terminado. You must use a formula returned by the Formula command. Ver Pasar un método de retrollamada (fórmula). | |
contraseña | text | Sólo Microsoft Excel (opcional) - La contraseña utilizada para proteger un documento MS Excel. | |
csvOptions | object | opciones de importación csv | |
range | object | Rango de celdas que contiene la primera celda donde se escribirán los datos. Si el rango especificado no es un rango de celdas, sólo se utiliza la primera celda del rango. | |
rowDelimiter | text | Delimitador de línea. Si no está presente, el delimitador es determinado automáticamente por 4D. | |
columnDelimiter | text | Delimitador de columna. Por defecto: "," | |
sjsOptions | object | opciones para la importación de sjs | |
calcOnDemand | boolean | Si se calculan las fórmulas sólo cuando se solicitan, por defecto es false. | |
dynamicReferences | boolean | Si calcular funciones con referencias dinámicas, por defecto es true. | |
fullRecalc | boolean | Si calcular después de cargar los datos json, false por defecto. | |
includeFormulas | boolean | Si se incluyen las fórmulas al cargar, por defecto es true. | |
includeStyles | boolean | Si se incluyen los estilos al cargar, por defecto es true. | |
includeUnusedStyles | boolean | Si se incluyen los estilos de nombre no utilizados al convertir excel xml a json, por defecto es true. | |
openMode | integer |
- 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. - Al importar un archivo con formato Microsoft Excel a un documento 4D View Pro, algunos parámetros pueden perderse. 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
Ejemplo 1
Desea importar un documento 4D View Pro por defecto almacenado en el disco, al abrir el formulario:
C_TEXT($docPath)
If(Form event code=On VP Ready) //Área 4D View Pro cargada y lista
$docPath:="C:\\Bases\\ViewProDocs\\MyExport.4VP"
VP IMPORT DOCUMENT("VPArea";$docPath)
End if
Ejemplo 2
Desea importar un documento Microsoft Excel protegido por contraseña a un área 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
Ejemplo 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:
Ver también
VP EXPORT DOCUMENT
VP NEW DOCUMENT
VP IMPORT FROM BLOB
VP IMPORT FROM BLOB ( vpAreaName : Text ; vpBlob : 4D.blob { ; paramObj : Object} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
vpBlob | 4D.Blob | -> | Blob que contiene un documento de 4D View Pro | |
paramObj | Object | -> | Opciones de importación |
Descripción
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.
En paramObj, puede pasar varias propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
formula | 4D.Function | Método de retrollamada que se lanzará cuando la importación haya finalizado. Ver Pasar un método de retrollamada (fórmula). |
calcOnDemand | Boolean | Si se calculan las fórmulas sólo cuando se solicitan, por defecto=false. |
dynamicReferences | Boolean | Si calcular funciones con referencia dinámica, por defecto=true. |
fullRecalc | Boolean | Si calcular después de cargar los datos json, false por defecto. |
includeFormulas | Boolean | Si se incluye la fórmula al cargar, por defecto=true. |
includeStyles | Boolean | Si se incluye el estilo al cargar, por defecto=true. |
includeUnusedStyles | Boolean | Si incluir el estilo de nombre no utilizado al convertir excel xml al json, default=true. |
openMode | Integer | puede ser: 0: modo abierto normal, sin lazy e incremental. Al abrir el documento, el evento de la interfaz de usuario y la interfaz de usuario podrían actualizarse y responder en puntos de tiempo específicos. 1: modo abierto perezoso (lazy). Al abrir el documento, solo la hoja activa se cargará directamente. Las demás hojas sólo se cargarán cuando se vayan a utilizar. 2: modo abierto incremental. Al abrir un documento, la interfaz de usuario y el evento de interfaz de usuario podrían actualizarse y responder directamente. |
Los siguientes parámetros se pueden utilizar en el método de retrollamada:
Parámetros | Tipo | Descripción | |
---|---|---|---|
param1 | text | El nombre del objeto de área 4D View Pro | |
param2 | 4D.Blob | El blob importado | |
param3 | object | Referencia al parámetro paramObj del comando | |
param4 | object | Un objeto devuelto por el método con un mensaje de estado | |
.success | boolean | True si la importación se realiza correctamente, False en caso contrario. | |
.errorCode | integer | Código de error. | |
.errorMessage | text | Mensaje de error. |
Ejemplo
Desea importar al "ViewProArea" un documento 4D View Pro previamente guardado como Blob en la primera entidad de la dataclass Table.
var $myBlobDocument : 4D.Blob :=ds.Table.all().first().blob
VP IMPORT FROM BLOB("ViewProArea"; $myBlobDocument)
Ver también
VP IMPORT FROM OBJECT
VP IMPORT FROM OBJECT ( vpAreaName : Text { ; viewPro : Object} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
viewPro | Object | -> | Objeto 4D View Pro |
Descripción
The VP IMPORT FROM OBJECT
command imports and displays the viewPro 4D View Pro object in the vpAreaName 4D View Pro area. El contenido del objeto importado sustituye todos los datos insertados en el área.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En viewPro, pase un objeto 4D View Pro válido. 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.
Ejemplo
Desea importar una hoja de cálculo que se ha guardado previamente en un campo objeto:
QUERY([VPWorkBooks];[VPWorkBooks]ID=10)
VP IMPORT FROM OBJECT("ViewProArea1";[VPWorkBooks]SPBook)
Ver también
VP INSERT COLUMNS
VP INSERT COLUMNS ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
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 se omite el número de columna a insertar (no se define), se inserta una sola columna.
New columns are inserted on the left, directly before the starting column in the rangeObj.
Ejemplo
Para insertar tres columnas antes de la segunda columna:
VP INSERT COLUMNS(VP Column("ViewProArea";1;3))
El resultado es:
Ver también
VP DELETE COLUMNS
VP DELETE ROWS
VP INSERT ROWS
VP INSERT ROWS
VP INSERT ROWS ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
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 se omite el número de línea a insertar (no se define), se inserta una sola línea.
New rows are inserted directly before the first row in the rangeObj.
Ejemplo
Para insertar 3 líneas antes de la primera línea:
VP INSERT ROWS(VP Row("ViewProArea";0;3))
El resultado es:
Ver también
VP DELETE COLUMNS
VP DELETE ROWS
VP INSERT COLUMNS
VP INSERT TABLE COLUMNS
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP INSERT TABLE COLUMNS ( vpAreaName : Text ; tableName : Text ; column : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
column | Integer | -> | Índice en la tabla de la columna inicial a insertar | |
count | Text | -> | Número de columnas a añadir (debe ser >0) | |
insertAfter | Integer | -> | vk table insert before or vk table insert after column | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
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 | Valor | Descripción |
---|---|---|
vk table insert before | 0 | Insert column(s) before the column (default if omitted) |
vk table insert after | 1 | Insertar columna(s) después de la columna |
This command inserts some columns in the tableName table, NOT in the sheet. El número total de columnas de la hoja no se ve afectado por el comando. Los datos presentes a la derecha de la tabla (si los hay) se desplazan automáticamente hacia la derecha según el número de columnas añadidas.
If tableName does not exist or if there is not enough space in the sheet, nothing happens.
Ejemplo
See examples for VP INSERT TABLE ROWS and VP SET TABLE COLUMN ATTRIBUTES.
Ver también
VP INSERT TABLE ROWS
VP REMOVE TABLE COLUMNS
VP SET TABLE COLUMN ATTRIBUTES
VP INSERT TABLE ROWS
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP INSERT TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
row | Integer | -> | Índice en la tabla de la línea inicial a insertar | |
count | Text | -> | Número de líneas a añadir (debe ser >0) | |
insertAfter | Integer | -> | vk table insert before or vk table insert after row | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
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 | Valor | Descripción |
---|---|---|
vk table insert before | 0 | Insert row(s) before the row (default if omitted) |
vk table insert after | 1 | Insertar línea(s) después de la línea |
This command inserts some rows in the tableName table, NOT in the sheet. El número total de líneas de la hoja no se ve afectado por el comando. Los datos presentes debajo de la tabla (si los hay) se desplazan automáticamente hacia abajo según el número de líneas añadidas.
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.
Ejemplo
Usted crea una tabla con un contexto de datos:
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")
Si quiere insertar dos líneas y dos columnas en la tabla, puede escribir:
VP INSERT TABLE ROWS("ViewProArea"; "PeopleTable"; 1; 2)
VP INSERT TABLE COLUMNS("ViewProArea"; "PeopleTable"; 1; 2)
Ver también
VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS
M
VP MOVE CELLS
Historia
Versión | Modificaciones |
---|---|
v19 R4 | Añadidos |
VP MOVE CELLS ( originRange : Object ; targetRange : Object ; options : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
originRange | Object | -> | Rango de celdas desde donde copiar | |
targetRange | Object | -> | Rango de destino para los valores, el formato y las fórmulas | |
options | Object | -> | Opciones adicionales |
Descripción
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.
El parámetro options tiene varias propiedades:
Propiedad | Tipo | Descripción | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
copy | Boolean | Determines if the values, formatting and formulas of the cells in originRange are removed after the command executes:
| ||||||||||||||
pasteOptions | Longint | Especifica lo que se pega. Possible values:
|
Se tienen en cuenta las opciones de pegado definidas en las opciones del libro de trabajo.
Ejemplo
Para copiar el contenido, los valores, el formato y las fórmulas de un rango origen:
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)
Ver también
VP Copy to object
VP PASTE FROM OBJECT
VP SET WORKBOOK OPTIONS
N
VP Name
VP Name ( vpAreaName : Text ; rangeName : Text { ; sheet : Integer } ) : Object
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
rangeName | Text | -> | Nombre del rango existente | |
sheet | Integer | -> | Ubicación del rango (hoja actual si se omite) | |
Result | Object | <- | Range object of name |
Descripción
The VP Name
command returns a new range object referencing a named range.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
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 se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual o todo el libro de trabajo con las siguientes constantes:
vk current sheet
vk workbook
Ejemplo
Quiere asignar un valor al rango llamado "Total".
// llama la celda B5 Total
VP ADD RANGE NAME(VP Cell("ViewProArea";1;4);"Total")
$name:=VP Name("ViewProArea";" Total")
VP SET NUM VALUE($name;285;"$#,###.00")
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
Descripción
The VP NEW DOCUMENT
command loads and display a new, default document in the 4D View Pro form area object vpAreaName. El nuevo documento vacío sustituye a los datos ya insertados en el área.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Ejemplo
Quiere mostrar un documento vacío en el objeto formulario "myVPArea":
VP NEW DOCUMENT("myVPArea")
Ver también
O
VP Object to font
VP Object to font ( fontObj : Object ) : Text
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
font object | Object | -> | Objeto fuente | |
Result | Text | <- | Fuente abreviada |
Descripción
The VP Object to font
command returns a font shorthand string from fontObj.
En fontObj, pase un objeto que contenga las propiedades de la fuente. Se soportan las siguientes propiedades:
Propiedad | Tipo | Descripción | Valores posibles | Obligatorio |
---|---|---|---|---|
family | text | Define la fuente. | todo tipo de familia de fuentes estándar o genérica. Ej. "Arial", "Helvetica", "serif", "arial,sans-serif" | Sí |
size | text | Defines the size of the font. The line-height can be added to the 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 | Sí |
style | text | Estilo de fuente. | vk font style italic vk font style oblique | No |
variant | text | Especifica el tipo de letra en minúsculas. | vk font variant small caps | No |
weight | text | Define el grosor de la fuente. | 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 | No |
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.
Ejemplo
$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"
Ver también
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
Historia
Versión | Modificaciones |
---|---|
v19 R4 | Añadidos |
VP PASTE FROM OBJECT ( rangeObj : Object ; dataObject : Object {; options : Longint} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto de rango de celda | |
dataObject | Object | -> | Objeto que contiene los datos a pegar | |
options | Longint | -> | Especifica lo que se pega |
Descripción
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. Si rangeObj se refiere a más de una celda, sólo se utiliza la primera.
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. Valores posibles:
|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.|
Se tienen en cuenta las opciones de pegado definidas en las opciones del libro de trabajo.
If options refers to a paste option not present in the copied object (e.g. formulas), the command does nothing.
Ejemplo
See example the example from VP Copy to object
Ver también
VP Copy to object
VP MOVE CELLS
VP Get workbook options
VP SET WORKBOOK OPTIONS
VP PRINT
VP PRINT ( vpAreaName : Text { ; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP PRINT
command opens a print dialog window to print vpAreaName.
Pass the 4D View Pro area to be printed in vpAreaName. El comando abrirá la ventana de diálogo de impresión del sistema donde se puede definir la impresora y las propiedades de la página.
Las propiedades definidas en la ventana de diálogo de impresión son para el papel de la impresora, no son las propiedades de impresión para el área 4D View Pro. Printing properties for 4D View Pro areas are defined using the VP SET PRINT INFO command. Se recomienda encarecidamente que las propiedades de la impresora y del área 4D View Pro coincidan, de lo contrario el documento impreso podría no corresponder a sus expectativas.
In the optional sheet parameter, you can designate a specific spreadsheet to print (counting begins at 0). Si se omite, la hoja actual se utiliza por defecto. Puedes seleccionar explícitamente la hoja de cálculo actual o todo el libro de trabajo con las siguientes constantes:
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
.- Este comando está destinado a la impresión individual por parte del usuario final. For automated print jobs, it is advised to export the 4D View Pro area as a PDF with the VP EXPORT DOCUMENT method.
Ejemplo
El código siguiente:
VP PRINT("myVPArea")
... abrirá una ventana de diálogo de impresión:
Ver también
VP EXPORT DOCUMENT
VP SET PRINT INFO
R
VP RECOMPUTE FORMULAS
VP RECOMPUTE FORMULAS ( vpAreaName : Text )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
Descripción
The VP RECOMPUTE FORMULAS
command immediately evaluates all formulas in vpAreaName. Por defecto, 4D calcula automáticamente las fórmulas cuando se insertan, importan o exportan. 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.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Be sure the VP SUSPEND COMPUTING command has not been executed before using
VP RECOMPUTE FORMULAS
, otherwise the command does nothing.
Ejemplo
Para refrescar todas las fórmulas del libro de trabajo:
VP RECOMPUTE FORMULAS("ViewProArea")
Ver también
VP RESUME COMPUTING
VP SUSPEND COMPUTING
VP REMOVE NAME
VP REMOVE NAME ( vpAreaName : Text ; name : Text { ; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
name | Text | -> | Nombre del rango nombrado o fórmula nombrada a eliminar | |
scope | Integer | -> | Alcance objetivo (por defecto=hoja actual) |
Descripción
The VP REMOVE NAME
command removes the named range or named formula passed in the name parameter in the defined scope.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
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
Ejemplo
$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
Ver también
VP REMOVE SHEET
VP REMOVE SHEET ( vpAreaName : Text ; index: Integer )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
index | Integer | -> | Índice de la hoja a eliminar |
Ver también
Descripción
The VP REMOVE SHEET
command removes the sheet with the specified index from the document loaded in vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
In index, pass the index of the sheet to remove. Si el index pasado no existe, el comando no hace nada.
La indexación comienza en 0.
Ejemplo
El documento tiene actualmente tres hojas:
Eliminar la tercera hoja:
VP REMOVE SHEET("ViewProArea";2)
VP REMOVE SPAN
VP REMOVE SPAN ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
The VP REMOVE SPAN
command removes the span from the cells in rangeObj.
En rangeObj, pase un objeto rango de la fusión. Las celdas fusionadas en el rango se dividen en celdas individuales.
Ejemplo
Para eliminar todas las fusiones de celdas de este documento:
//find all cell spans
$span:=VP Get spans(VP All("ViewProArea"))
//remove the cell spans
VP REMOVE SPAN($span)
Resultado:
Ver también
VP REMOVE STYLESHEET
VP REMOVE STYLESHEET ( vpAreaName : Text ; styleName : Text { ; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
styleName | Text | -> | Nombre del estilo a eliminar | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP REMOVE STYLESHEET
command removes the style sheet passed in the styleName from the vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Pase la hoja de estilo a eliminar en el parámetro styleName.
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
Ejemplo
To remove the GreenDashDotStyle style object from the current sheet:
VP REMOVE STYLESHEET("ViewProArea";"GreenDashDotStyle")
Ver también
VP ADD STYLESHEET
VP Get stylesheet
VP Get stylesheets
VP REMOVE TABLE
Historia
Versión | Modificaciones |
---|---|
v19 R6 | Añadidos |
VP REMOVE TABLE ( vpAreaName : Object; tableName : Text {; options : Integer} {; sheet : Integer}} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área View Pro | |
tableName | Text | -> | Nombre de la tabla a eliminar | |
options | Integer | -> | Opciones adicionales | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
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.
En tableName, pase el nombre de la tabla a eliminar.
In options, you can specify additional behavior. Los valores posibles son:
Constante | Valor | Descripción |
---|---|---|
vk table remove all | 0 | Eliminar todos los estilos y datos incluidos |
vk table remove style | 1 | Eliminar estilo pero mantener datos |
vk tabla eliminar datos | 2 | Eliminar datos pero mantener el estilo |
Los nombres de tablas se definen a nivel de la hoja. You can specify where the table is located using the optional sheet parameter (indexing starts at 0).
Ejemplo
Para eliminar la tabla "people" en la segunda hoja y mantener los datos en las celdas:
VP REMOVE TABLE("ViewProArea"; "people"; vk table remove style; 2)
Ver también
VP REMOVE TABLE COLUMNS
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP REMOVE TABLE COLUMNS ( vpAreaName : Text ; tableName : Text ; column : Integer {; count : Integer {; sheet : Integer }}} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
column | Integer | -> | Índice en la tabla de la columna inicial a eliminar | |
count | Text | -> | Número de columnas a eliminar (debe ser >0) | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP REMOVE TABLE COLUMNS
command removes one or count column(s) in the specified tableName at the specified column index. El comando elimina valores y estilos.
The command removes columns from the tableName table, NOT from the sheet. El número total de columnas de la hoja no se ve afectado por el comando. Los datos a la derecha de la tabla (si los hay) se desplazan automáticamente a la izquierda según el número de columnas eliminadas.
Si tableName no existe, no pasa nada.
Ejemplo
Para eliminar dos columnas de la tercera columna de la tabla "dataTable":
VP REMOVE TABLE COLUMNS("ViewProArea"; "dataTable"; 3; 2)
Ver también
VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS
VP REMOVE TABLE ROWS
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP REMOVE TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; sheet : Integer }}} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
row | Integer | -> | Índice en la tabla de la línea inicial a eliminar | |
count | Text | -> | Número de líneas a eliminar (debe ser >0) | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP REMOVE TABLE ROWS
command removes one or count row(s) from the specified tableName at the specified row index. El comando elimina valores y estilos.
Este comando elimina las líneas de la tabla tableName, NO de la hoja. El número total de líneas de la hoja no se ve afectado por el comando. Los datos presentes debajo de la tabla (si los hay) se desplazan automáticamente hacia arriba en función del número de líneas eliminadas.
If the tableName table is bound to a data context, the command removes element(s) from the collection.
Si tableName no existe, no pasa nada.
Ejemplo
Para eliminar dos líneas de la tercera línea de la tabla "dataTable":
VP REMOVE TABLE ROWS("ViewProArea"; "dataTable"; 3; 2)
Ver también
VP INSERT TABLE ROWS
VP REMOVE TABLE COLUMNS
VP RESET SELECTION
VP RESET SELECTION ( vpAreaName : Text { ; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP RESET SELECTION
command deselects all cells, resulting in no current selection or visible active cell.
Una celda activa por defecto (celda A1) permanece definida para los comandos 4D View Pro.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
Desea deseleccionar todas las celdas (la celda activa y cualquier otra celda seleccionada):
VP RESET SELECTION("myVPArea")
Ver también
VP ADD SELECTION
VP Get active cell
VP Get selection
VP SET ACTIVE CELL
VP SET SELECTION
VP SHOW CELL
VP RESIZE TABLE
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP RESIZE TABLE ( rangeObj : Object; tableName : Text )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Nuevo rango para la tabla | |
tableName | Text | -> | Nombre de la tabla |
Descripción
The VP RESIZE TABLE
command changes the tableName size with regards to the rangeObj.
Se aplican las siguientes reglas:
- Los encabezados deben permanecer en la misma línea y el rango de la tabla resultante debe superponerse al rango de la tabla original.
- 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.
- Si la tabla se expande en las celdas que contienen datos:
- si se añaden líneas, se eliminan datos,
- si se añaden columnas, los datos se mantienen y se muestran en nuevas columnas.
Si tableName no existe, no pasa nada.
Ejemplo
Usted crea una tabla con un contexto de datos:
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")
Quiere añadir una columna antes y después de la tabla, así como dos líneas vacías. Puede escribir:
VP RESIZE TABLE(VP Cells("ViewProArea"; 0; 1; 4; 6); "PeopleTable")
Ver también
VP CREATE TABLE
VP Get table range
VP RESUME COMPUTING
VP RESUME COMPUTING ( vpAreaName : Text )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
Descripción
The VP RESUME COMPUTING
command restarts the calculation of formulas in vpAreaName.
El comando reactiva el servicio de cálculo 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.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El servicio de cálculo de 4D View Pro mantiene un contador de acciones de suspensión/reanudación. Therefore, each execution of
VP RESUME COMPUTING
must be balanced by a corresponding execution of the VP SUSPEND COMPUTING command.
Ejemplo
Ver ejemplo en VP SUSPEND COMPUTING.
Ver también
VP RECOMPUTE FORMULAS
VP SUSPEND COMPUTING
VP Row
VP Row ( vpAreaName : Text; row : Integer { ; rowCount : Integer { ; sheet : Integer } } ) : Object
Parámetros | Tipo | Descripción | |
---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
row | Integer | -> | Índice de la línea |
rowCount | Integer | -> | Número de líneas |
|sheet |Integer|->|Sheet index (current sheet if omitted)| |Result |Object|<-|Range object of row(s)|
Descripción
The VP Row
command returns a new range object referencing a specific row or rows.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El parámetro row define la primera fila del rango de filas. Pase el índice de la línea (el conteo comienza en 0) en este parámetro. 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 debe ser mayor que 0. Si se omite, el valor será 1 por defecto.
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si no se especifica, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
Desea definir un objeto rango para la línea que se muestra a continuación (en la hoja de cálculo actual):
Puede escribir:
$row:=VP Row("ViewProArea";9) // línea 10
Ver también
VP All
VP Cell
VP Cells
VP Column
VP Combine ranges
VP Name
VP ROW AUTOFIT
VP ROW AUTOFIT ( rangeObj : Object)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
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.
Ejemplo
Las siguientes líneas no muestran correctamente el texto:
VP ROW AUTOFIT(VP Row("ViewProArea";1;2))
Resultado:
Ver también
VP Run offscreen area
VP Run offscreen area ( parameters : Object) : Mixed
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
parameters | Object | -> | Objeto que contiene los atributos del área fuera de pantalla | |
Result | Mixed | <- | .result property of the .onEvent object, or Null if does not return a value |
Descripción
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:
Propiedad | Tipo | Descripción |
---|---|---|
area | text | El nombre del área fuera de la pantalla. Si se omite o es null, se asigna un nombre genérico (por ejemplo, "OffscreenArea1"). |
onEvent | objet (fórmula) | Un método retro llamada que se lanzará cuando el área fuera de la pantalla esté lista. 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 | Tiempo máximo (expresado en segundos) antes de que el área se cierre automáticamente si no se genera ningún evento. Si se fija en 0, no se aplica ninguna limitación. Valor por defecto: 60 |
result | mixto | Resultado del procesamiento (si hay) |
<customProperty> | mixto | Any custom attribute to be available in the onEvent callback method. |
La siguiente propiedad es añadida automáticamente por el comando si es necesario:
Propiedad | Tipo | Descripción |
---|---|---|
timeoutReached | boolean | Añadido con el valor true si se ha excedido el tiempo de espera |
The offscreen area is only available during the execution of the
VP Run offscreen area
command. Se destruirá automáticamente una vez finalizada la ejecución.
Los siguientes comandos se pueden utilizar en el método de retrollamada:
ACCEPT
CANCEL
SET TIMER
WA Evaluate JavaScript
WA EXECUTE JAVASCRIPT FUNCTION
Ejemplo 1
Quiere crear un área 4D View Pro fuera de la pantalla y obtener el valor de una celda:
// 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
El método de retrollamada OffscreenArea:
$o:=cs.OffscreenArea.new()
$result:=VP Run offscreen area($o)
Ejemplo 2
Quiere cargar un documento grande fuera de la pantalla, esperar a que todos los cálculos se completen y exportarlo como 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
El método de retrollamada OffscreenArea:
$o:=cs.OffscreenArea.new()
$result:=VP Run offscreen area($o)
Ver también
Blog post: End of document loading
S
VP SET ACTIVE CELL
VP SET ACTIVE CELL ( rangeObj : Object)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango |
Descripción
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). Si rangeObj no es un rango de celdas o contiene varios rangos, se utiliza la primera celda del primer rango.
Ejemplo
Para definir la celda de la columna D, línea 5 como celda activa:
$activeCell:=VP Cell("myVPArea";3;4)
VP SET ACTIVE CELL($activeCell)
Ver también
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)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
methodObj | Object | -> | Métodos permitidos en las áreas 4D View Pro |
Compatibilidad
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.
Descripción
The VP SET ALLOWED METHODS
command designates the project methods that can be called in 4D View Pro formulas. Este comando se aplica a todas las áreas 4D View Pro inicializadas después de su llamada durante la sesión. Se puede llamar varias veces en la misma sesión para inicializar diferentes configuraciones.
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). El uso de un método no autorizado en una fórmula muestra un error #NAME? error en el área 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:
Propiedad | Tipo | Descripción | ||
---|---|---|---|---|
<functionName> | Object | Definición de la función personalizada. The <functionName> property name defines the name of the custom function to display in 4D View Pro formulas (no spaces allowed) | ||
method | Text | (obligatorio) Nombre del método proyecto 4D existente a autorizar | ||
parameters | Colección de objetos | Colección de parámetros (en el orden en que están definidos en el método). | ||
[ ].name | Text | Name of a parameter to display for the <functionName> .Note: Parameter names must not contain space characters. | ||
[ ].type | Number | Tipo de parámetro. 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 | Descripción de la función a mostrar en 4D View Pro | ||
minParams | Number | Número mínimo de parámetros | ||
maxParams | Number | Número máximo de parámetros. Pasar un número superior a la longitud de los parámetros permite declarar parámetros "opcionales" con tipo por defecto |
Ejemplo
Usted quiere autorizar dos métodos en sus áreas 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)
Una vez ejecutado este código, las funciones definidas pueden utilizarse en las fórmulas 4D View Pro:
En las fórmulas 4D View Pro, los nombres de las funciones se muestran automáticamente en mayúsculas.
Ver también
4D functions
VP SET CUSTOM FUNCTIONS
VP SET BINDING PATH
Historia
Versión | Modificaciones |
---|---|
v19 R5 | Añadidos |
VP SET BINDING PATH ( rangeObj : Object ; dataContextAttribute : Text)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
dataContextAttribute | Text | -> | Nombre del atributo a vincular a rangeObj |
Descripción
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.
En rangeObj, pase un objeto que es un rango de celdas o un rango combinado de celdas.
- 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.
Los atributos de tipo colección no están soportados. Cuando se pasa el nombre de un atributo de la colección, el comando no hace nada.
Ejemplo
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")
Ver también
VP Get binding path
VP Get data context
VP SET DATA CONTEXT
VP SET BOOLEAN VALUE
VP SET BOOLEAN VALUE ( rangeObj : Object ; boolValue : Boolean)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
boolValue | Boolean | -> | Valor del booleano a definir |
Descripción
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.
Ejemplo
//Establecer el valor de la celda como False
VP SET BOOLEAN VALUE(VP Cell("ViewProArea";3;2);False)
Ver también
VP SET BORDER
VP SET BORDER ( rangeObj : Object ; borderStyleObj : Object ; borderPosObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
borderStyleObj | Object | -> | Objeto que contiene el estilo de línea de borde | |
borderPosObj | Object | -> | Objeto que contiene la posición del borde |
Descripción
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. borderStyleObj soporta las siguientes propiedades:
Propiedad | Tipo | Descripción | Valores posibles |
---|---|---|---|
color | text | Define el color del borde. Por defecto = black. | Sintaxis de color CSS "#rrggbb" (sintaxis preferida), sintaxis de color CSS "rgb(r,g,b)" (sintaxis alternativa), nombre de color CSS (sintaxis alternativa) |
style | Integer | Define el estilo del borde. Por defecto = 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:
Propiedad | Tipo | Descripción |
---|---|---|
all | boolean | Estilo de la línea de borde aplicado a todos los bordes. |
left | boolean | Estilo de la línea de borde aplicado al borde izquierdo. |
top | boolean | Estilo de la línea de borde aplicado al borde superior. |
right | boolean | Estilo de la línea de borde aplicado al borde derecho. |
bottom | boolean | Estilo de la línea de borde aplicado al borde inferior. |
outline | boolean | Estilo de línea de borde aplicado únicamente a los bordes exteriores. |
inside | boolean | Estilo de la línea de borde aplicado únicamente a los bordes interiores. |
innerHorizontal | boolean | Estilo de la línea de borde aplicado únicamente a los bordes horizontales interiores. |
innerVertical | boolean | Estilo de la línea de borde aplicado sólo a los bordes verticales interiores. |
Ejemplo 1
Este código produce un borde alrededor de todo el rango:
$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)
Ejemplo 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)
Ver también
VP SET CELL STYLE
VP SET CELL STYLE ( rangeObj : Object ; styleObj : Object)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
styleObj | Object | -> | Objeto style |
Descripción
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. Puede utilizar una hoja de estilo existente o crear una nueva. 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.
Para eliminar un estilo y volver a la configuración de estilo por defecto (si la hay), pase un valor NULL:
- 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.
Ejemplo
$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)
Ver también
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)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
propertyObj | Object | -> | Objeto que contiene las propiedades de columna |
Descripción
The VP SET COLUMN ATTRIBUTES
command applies the attributes defined in the propertyObj to the columns in the rangeObj.
En rangeObj, pase un objeto que contenga un rango. Si el rango contiene tanto columnas como líneas, los atributos se aplican sólo a las columnas.
The propertyObj parameter lets you specify the attributes to apply to the columns in the rangeObj. Estos atributos son:
Propiedad | Tipo | Descripción |
---|---|---|
ancho | number | Ancho de columna expresado en píxeles |
pageBreak | boolean | True para insertar un salto de página antes de la primera columna del rango, si no, false |
visible | boolean | True si la columna es visible, si no, false |
redimensionable | boolean | True si la columna puede redimensionarse, si no, false |
header | text | Texto del encabezado de la columna |
Ejemplo
Para cambiar el tamaño de la segunda columna y definir el encabezado, se escribe:
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)
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
columnCount | Integer | -> | Número de columnas | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP SET COLUMN COUNT
command defines the total number of columns in vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Pass the total number of columns in the columnCount parameter. columnCount debe ser mayor que 0.
In the optional sheet parameter, you can designate a specific spreadsheet where the columnCount will be applied (counting begins at 0). Si se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
El siguiente código define cinco columnas en el área de 4D View Pro:
VP SET COLUMN COUNT("ViewProArea";5)
Ver también
VP Get column count
VP Get row count
VP SET ROW COUNT
VP SET CURRENT SHEET
VP SET CURRENT SHEET ( vpAreaName : Text ; sheet : Integer)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
sheet | Integer | <- | Índice de la nueva hoja actual |
Descripción
The VP SET CURRENT SHEET
command sets the current sheet in vpAreaName . La hoja actual es la hoja seleccionada en el documento.
En vpAreaName, pase el nombre del área 4D View Pro.
En sheet, pase el índice de la hoja que se va a definir como hoja actual. Si el índice pasado es inferior a 0 o supera el número de hojas, el comando no hace nada.
La indexación comienza en 0.
Ejemplo
La hoja actual del documento es la primera hoja:
Define la hoja actual en la tercera hoja:
VP SET CURRENT SHEET("ViewProArea";2)
Ver también
VP SET CUSTOM FUNCTIONS
VP SET CUSTOM FUNCTIONS ( vpAreaName : Text ; formulaObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
formulaObj | Object | -> | Objeto fórmula |
Descripción
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.
Pase el nombre del área de 4D View Pro en vpAreaName. Si pasa un nombre que no existe, se devuelve un error.
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.
Propiedad | Tipo | Descripción | ||
---|---|---|---|---|
<customFunction> | Object | Definición de la función personalizada. <customFunction> defines the name of the custom function to display in 4D View Pro formulas (no spaces allowed) | ||
formula | Object | Objeto fórmula 4D (obligatorio). Ver el comando Formula . | ||
parameters | Colección de objetos | Colección de parámetros (en el orden en que están definidos en la fórmula) | ||
[ ].name | Text | Nombre del parámetro a mostrar en 4D View Pro | ||
[ ].type | Number | Tipo de parámetro. 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 | Descripción de la Fórmula a mostrar en 4D View Pro | ||
minParams | Number | Número mínimo de parámetros | ||
maxParams | Number | Número máximo de parámetros. Passing a number higher than the length of parameters allows declaring "optional" parameters with default type |
ATENCIÓN
- 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.- En cuanto se llama a
VP SET CUSTOM FUNCTIONS
, las funciones basadas en los comandosSET TABLE TITLES
ySET FIELD TITLES
son ignoradas en el área 4D View Pro.
Ejemplo
Desea utilizar los objetos fórmula en un área 4D View Pro para añadir números, recuperar el apellido y el género de un cliente:
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
Ver también
VP SET DATA CONTEXT
Historia
Versión | Modificaciones |
---|---|
v19 R5 | Añadidos |
VP SET DATA CONTEXT ( vpAreaName : Text ; dataObj : Object {; options : Object } {; sheet : Integer} )
VP SET DATA CONTEXT ( vpAreaName : Text ; dataColl : Collection ; {options : Object } {; sheet : Integer} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nombre de objeto formulario área 4D View Pro | |
dataObj | Object | -> | Objeto datos a cargar en el contexto de datos | |
dataColl | Collection | -> | Colección datos a cargar en el contexto de datos | |
options | Object | -> | Opciones adicionales | |
sheet | Integer | -> | Índice de la hoja |
Descripción
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.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
In dataObj or dataColl, pass an object or a collection containing the data to load in the data context. Las imágenes se convierten en esquemas URI de datos.
To pass a time value in dataObj or dataColl, encapsulate it in an object with the following properties (see example 4):
Propiedad | Tipo | Descripción |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Valor a poner en el contexto |
time | Real | Valor de tiempo (en segundos) para poner en el contexto |
En options, puede pasar un objeto que especifique las opciones adicionales. Las propiedades posibles son:
Propiedad | Tipo | Descripción |
---|---|---|
reset | Object | True para restablecer el contenido de la hoja antes de cargar el nuevo contexto, False (por defecto) en caso contrario. |
autoGenerateColumns | Object | Sólo se utiliza cuando los datos son una colección. True (por defecto) para especificar que las columnas deben generarse automáticamente cuando se vincula el contexto de datos. In this case, the following rules apply:
|
In sheet, pass the index of the sheet that will receive the data context. Si no se pasa ningún índice, el contexto se aplica a la hoja actual.
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. Para más detalles, consulte la descripción de esos métodos.
Ejemplo
Pasa un objeto y vincula los datos del contexto a las celdas en la primera línea:
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")
Ejemplo 2
Pasa una colección de objetos y genera columnas automáticamente:
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)
Ejemplo 3
The data passed as a parameter is a collection that contains subcollections. Cada subcolección define el contenido de una línea:
var $data : Collection
var $options : Object
$data:=New collection
$data.push(New collection(1; 2; 3; False; "")) // Se crean 5 columnas
$data.push(New collection) // La segunda línea está vacía
$data.push(New collection(4; 5; Null; "hello"; "world")) // La tercera línea tiene 5 valores
$data.push(New collection(6; 7; 8; 9)) // La cuarta línea tiene 4 valores
$options:=New object("autoGenerateColumns"; True)
VP SET DATA CONTEXT("ViewProArea"; $data; $options)
Ejemplo 4 - Sintaxis de fecha y hora
var $data : Collection
var $options : Object
$data:= New collection()
// Las fechas pueden pasarse como valores escalares
$data.push(New collection("Date"; Current date))
// Los valores hora deben pasarse como atributos objeto
$data.push(New collection("Time"; New object("time"; 5140)))
// Ejemplo de fecha + hora
$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)
Este es el resultado una vez que se generan las columnas:
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
dateValue | Fecha | -> | Valor date a definir | |
timeValue | Hora | -> | Valor hora a definir | |
formatPattern | Text | -> | Formato del valor |
Descripción
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.
Ejemplo
//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)
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
dateValue | Fecha | -> | Valor date a definir | |
formatPattern | Text | -> | Formato del valor |
Descripción
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. Pase un formato personalizado o puede utilizar una de las siguientes constantes:
Constante | Descripción | Configuración por defecto de US |
---|---|---|
vk pattern long date | Formato ISO 8601 para la fecha completa | "dddd, dd MMMM yyyy" |
vk pattern month day | Formato ISO 8601 para el mes y el día | "MMMM dd" |
vk pattern short date | Formato ISO 8601 corto para la fecha | "MM/dd/yyyy" |
vk pattern year month | Formato ISO 8601 para el mes y el año | "yyyy MMMM" |
For information on patterns and formatting characters, please refer to the Date and time formats section.
Ejemplo
//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)
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
styleObj | Object | -> | Objeto style | |
sheet | Integer | -> | Índice de la hoja (por defecto = hoja actual) |
Descripción
The VP SET DEFAULT STYLE
command defines the style in the styleObj as the default style for a sheet.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
The styleObj lets you pass an object containing style settings. Puede utilizar una hoja de estilo existente o puede crear un nuevo estilo. 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 se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
$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)
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
campo | Puntero | -> | Referencia al campo en la estructura virtual | |
formatPattern | Text | -> | Formato del campo |
Descripción
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.
El parámetro opcional formatPattern define un modelo para el parámetro field. You can pass any valid custom format.
Ejemplo
VP SET FIELD(VP Cell("ViewProArea";5;2);->[TableName]Field)
Ver también
VP SET FORMULA
VP SET FORMULA ( rangeObj : Object ; formula : Text { ; formatPattern : Text } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
formula | Text | -> | Fórmula o método 4D | |
formatPattern | Text | -> | Formato del campo |
Descripción
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 ("").
Ejemplo 1
VP SET FORMULA(VP Cell("ViewProArea";5;2);"SUM($A$1:$C$10)")
Ejemplo 2
Para eliminar la fórmula:
VP SET FORMULA(VP Cell("ViewProArea";5;2);"")
Ejemplo 3
VP SET FORMULA($range; "SUM(A1,B7,C11)") //"," para separar los parámetros
Ver también
Cell format
VP Get Formula
VP SET FORMULAS
VP SET VALUE
VP SET FORMULAS
VP SET FORMULAS ( rangeObj : Object ; formulasCol : Collection )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto de rango de celda | |
formulasCol | Collection | -> | Colección de fórmulas |
Descripción
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 colección de primer nivel contiene subcolecciones de fórmulas. Cada subcolección define una línea.
- Cada subcolección define los valores de las celdas para la línea. Los valores deben ser elementos textuales que contengan las fórmulas a asignar a las celdas.
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 ("").
Ejemplo 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
Ejemplo 2
Para eliminar las fórmulas:
$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
Ver también
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 } )
Parámetros | Tipo | Descripción | |
---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
paneObj | Object | -> | Objeto que contiene la información de las columnas y líneas congeladas |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
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. . Frozen columns and rows are fixed in place and do not move when the rest of the document is scrolled. A solid line is displayed to indicate that columns and rows are frozen.
- 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. Para las columnas situadas a la derecha de la hoja, la línea se muestra a la izquierda de la primera columna congelada.
- Rows on the top or bottom: For rows at the top of the sheet, the line is displayed below the last frozen row. Para las líneas situadas en la parte inferior de la hoja, la línea se muestra sobre la primera línea congelada.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
You can pass an object defining the columns and rows to freeze in the paneObj parameter. Al definir el valor de una propiedad de columna o de línea en cero, se restablece (descongela) la propiedad. Si una propiedad está definida como menor que cero, el comando no hace nada. Puede pasar:
Propiedad | Tipo | Descripción |
---|---|---|
columnCount | Integer | El número de columnas congeladas a la izquierda de la hoja |
trailingColumnCount | Integer | El número de columnas congeladas a la derecha de la hoja |
rowCount | Integer | El número de líneas congeladas en la parte superior de la hoja |
trailingRowCount | Integer | El número de líneas congeladas en la parte inferior de la hoja |
En el parámetro opcional sheet, puede designar una hoja específica donde se definirá el rango (la numeración comienza en 0). Si se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
Quiere congelar las tres primeras columnas de la izquierda, dos columnas de la derecha y la primera línea:
C_OBJECT($panes)
$panes:=New object
$panes.columnCount:=3
$panes.trailingColumnCount:=2
$panes.rowCount:=1
VP SET FROZEN PANES("ViewProArea";$panes)
Ver también
VP SET NUM VALUE
VP SET NUM VALUE ( rangeObj : Object ; numberValue : Number { ; formatPattern : Text } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
numberValue | Number | -> | Valor del número a definir | |
formatPattern | Text | -> | Formato del valor |
Descripción
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.
Ejemplo
//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_)")
Ver también
VP SET PRINT INFO
VP SET PRINT INFO ( vpAreaName : Text ; printInfo : Object { ; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre del área 4D View Pro | |
printInfo | Object | -> | Objeto que contiene los atributos de impresión | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
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 pasa un nombre que no existe, se devuelve un error.
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 se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
El siguiente código imprimirá un área 4D View Pro en un documento 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!"))))
El PDF:
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Rango de líneas | |
propertyObj | Object | -> | Objeto que contiene las propiedades de las líneas |
Descripción
The VP SET ROW ATTRIBUTES
command applies the attributes defined in the propertyObj to the rows in the rangeObj.
En rangeObj, pase un objeto que contenga un rango. Si el rango contiene tanto columnas como líneas, los atributos se aplican sólo a las líneas.
The propertyObj parameter lets you specify the attributes to apply to the rows in the rangeObj. Estos atributos son:
Propiedad | Tipo | Descripción |
---|---|---|
height | number | Altura de la línea expresada en píxeles |
pageBreak | boolean | True para insertar un salto de página antes de la primera línea del rango, si no, false |
visible | boolean | True si la fila es visible, si no, false |
redimensionable | boolean | True si la línea puede redimensionarse, si no, false |
header | text | Texto del encabezado de la línea |
Ejemplo
Quiere cambiar el tamaño de la segunda línea y definir el encabezado:
var $row; $properties : Object
$row:=VP Row("ViewProArea";1)
$properties:=New object("height";75;"header";"June")
VP SET ROW ATTRIBUTES($row;$properties)
Ver también
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 } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
rowCount | Integer | -> | Número de líneas | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP SET ROW COUNT
command defines the total number of rows in vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Pase el número total de líneas en el parámetro rowCount. rowCount debe ser mayor que 0.
In the optional sheet parameter, you can designate a specific spreadsheet where the rowCount will be applied (counting begins at 0). Si se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo
El siguiente código define cinco líneas en el área 4D View Pro:
VP SET ROW COUNT("ViewProArea";5)
Ver también
VP Get column count
VP get row-count
VP SET COLUMN COUNT
VP SET SELECTION
VP SET SELECTION ( rangeObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango de celdas |
Descripción
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.
Ejemplo
$currentSelection:=VP Combine ranges(VP Cells("myVPArea";3;2;1;6);VP Cells("myVPArea";5;7;1;7))
VP SET SELECTION($currentSelection)
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
number | Integer | -> | Número de hojas |
Descripción
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. Por ejemplo, si hay 5 hojas en su documento y define el conteo de hojas en 3, el comando borrará las hojas número 4 y 5.
Ejemplo
El documento tiene actualmente una hoja:
Para definir el número de hojas en 3:
VP SET SHEET COUNT("ViewProArea";3)
Ver también
VP SET SHEET NAME
VP SET SHEET NAME ( vpAreaName : Text ; name : Text {; sheet: Integer} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
name | Text | -> | Nuevo nombre para la hoja | |
sheet | Integer | -> | Índice de la hoja a renombrar |
Descripción
The VP SET SHEET NAME
command renames a sheet in the document loaded in vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
En name, pase un nuevo nombre para la hoja.
In sheet, pass the index of the sheet to rename.
La indexación comienza en 0.
If no sheet is passed, the command renames the current sheet.
El nuevo nombre no puede contener los siguientes caracteres: *, :, [, ], ?,\,/
El comando no hace nada si:
- el nuevo nombre contiene caracteres prohibidos
- el nuevo valor del nombre está en blanco
- el nuevo nombre ya existe
- el índice sheet pasado no existe
Ejemplo
Establezca el nombre de la tercera hoja como "Total first quarter":
VP SET SHEET NAME("ViewProArea";"Total first quarter";2)
VP SET SHEET OPTIONS
VP SET SHEET OPTIONS ( vpAreaName : Text; sheetOptions : Object { ; sheet : Integer} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Object | -> | Nombre del área 4D View Pro | |
sheetOptions | Object | -> | Opciones de la hoja a definir | |
sheet | Object | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP SET SHEET OPTIONS
command allows defining various sheet options of the vpAreaName area.
Pase el nombre del área de 4D View Pro en vpAreaName. Si pasa un nombre que no existe, se devuelve un error.
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.
En el parámetro opcional sheet, puede designar una hoja específica (la numeración comienza en 0). Si se omite, se utiliza por defecto la hoja de cálculo actual. Puede seleccionar explícitamente la hoja de cálculo actual con la siguiente constante:
vk current sheet
Ejemplo 1
Quiere proteger todas las celdas excepto el rango 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))
Ejemplo 2
Necesita proteger su documento mientras sus usuarios pueden redimensionar las líneas y columnas:
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)
Ejemplo 3
Desea personalizar los colores de sus pestañas, líneas congeladas, líneas de cuadrícula, fondo de selección y borde de selección:
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)
Resultado:
Ejemplo 4
Quiere ocultar las líneas de la cuadrícula, así como los encabezados de las líneas y columnas.
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)
Resultado:
Ver también
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} )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
visible | Boolean | -> | Líneas de impresión mostradas si True (por defecto), ocultas si es False | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP SET SHOW PRINT LINES
command sets whether to display print preview lines in a spreadsheet..
En vpAreaName, pase el nombre del área 4D View Pro.
In visible, pass True
to display the print lines, and False
to hide them. Por defecto se pasa True
.
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice, el comando se aplica a la hoja actual.
La indexación comienza en 0.
La posición de las líneas de impresión de una hoja de cálculo varía según los saltos de página de dicha hoja.
Ejemplo
El siguiente código muestra las líneas de impresión en la segunda hoja de un documento:
VP SET SHOW PRINT LINES("ViewProArea";True;1)
Con un salto de página:
Ver también
VP SET TABLE COLUMN ATTRIBUTES
Historia
Versión | Modificaciones |
---|---|
v19 R7 | Añadidos |
VP SET TABLE COLUMN ATTRIBUTES ( vpAreaName : Text ; tableName : Text ; column : Integer ; attributes : Object {; sheet : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
column | Integer | -> | Índice de la columna en la tabla | |
attributes | Object | -> | Atributo(s) a aplicar a column | |
sheet | Integer | -> | Índice de la hoja (hoja actual si se omite) |
Descripción
The VP SET TABLE COLUMN ATTRIBUTES
command applies the defined attributes to the column in the tableName.
En vpAreaName, pase el nombre del área 4D View Pro.
In the attributes parameter, pass an object that contains the properties to set:
Propiedad | Tipo | Descripción |
---|---|---|
dataField | text | Nombre de la propiedad de la columna de la tabla en el contexto de datos. |
name | text | Nombre de la columna de la tabla. Debe ser único en la tabla. Si este nombre ya es utilizado por otra columna, no se aplica y se utiliza automáticamente un nombre por defecto. |
formula | text | Define la fórmula para cada celda de la columna. See Structured Reference Formulas in the SpreadJS documentation |
footerText | text | Valor del pie de columna. |
footerFormula | text | Fórmula del pie de columna. |
filterButtonVisible | boolean | Sets whether the table column's filter button is displayed (default is True when the table is created). |
En sheet, pase el índice de la hoja objetivo. Si no se especifica ningún índice o si pasa -1, el comando se aplica a la hoja actual.
La indexación comienza en 0.
If tableName is not found or if column is higher than the number of columns, the command does nothing.
Ejemplo
Usted crea una tabla con un contexto de datos:
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)
A continuación, desea insertar una columna con datos del contexto de datos y ocultar algunos botones de filtro:
//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))
Ver también
VP CREATE TABLE
VP Find table
VP Get table column attributes
VP RESIZE TABLE
VP SET TABLE THEME
Historia
Versión | Modificaciones |
---|---|
v19 R8 | Añadidos |
VP SET TABLE THEME ( vpAreaName : Text ; tableName : Text ; options : cs.ViewPro.TableTheme )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
tableName | Text | -> | Nombre de la tabla | |
options | cs.ViewPro.TableTheme | -> | Propiedades del tema de la tabla a modificar |
Descripción
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.
Ejemplo 1
Desea definir un tema predefinido en una tabla:
var $param : cs.ViewPro.TableTheme
$param:=cs.ViewPro.TableTheme.new()
$param.theme:="medium2"
VP SET TABLE THEME("ViewProArea"; "myTable"; $param)
Ejemplo 2
Quiere tener esta representación de columna alternativa:
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)
Ver también
VP CREATE TABLE
VP Get table theme
VP SET TEXT VALUE
VP SET TEXT VALUE ( rangeObj : Object ; textValue : Text { ; formatPattern : Text } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
textValue | Text | -> | Valor texto a definir | |
formatPattern | Text | -> | Formato del valor |
Descripción
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.
Ejemplo
VP SET TEXT VALUE(VP Cell("ViewProArea";3;2);"Test 4D View Pro")
Ver también
VP SET TIME VALUE
VP SET TIME VALUE ( rangeObj : Object ; timeValue : Text { ; formatPattern : Text } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
timeValue | Text | -> | Valor hora a definir | |
formatPattern | Text | -> | Formato del valor |
Descripción
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.
Ejemplo
//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)
Ver también
Cell Format
VP SET DATE TIME VALUE
VP SET VALUE
VP SET VALUE
VP SET VALUE ( rangeObj : Object ; valueObj : Object )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
valueObj | Object | -> | Valores de la celda y opciones de formato |
Descripción
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. Puede contener las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Valor a asignar a rangeObj (excepto- hora). Pase null para borrar el contenido de la celda. |
time | Real | Time value (in seconds) to assign to rangeObj |
format | Text | Patrón de propiedad valor/tiempo. For information on patterns and formatting characters, please refer to the Cell Format paragraph. |
Ejemplo
//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))
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
valuesCol | Collection | -> | Colección de valores |
Descripción
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.
El parámetro valuesCol es bidimensional:
- La colección de primer nivel contiene subcolecciones de valores. Cada subcolección define una línea. Pasa una colección vacía para saltar una línea.
- Cada subcolección define los valores de las celdas para la línea. Los valores pueden ser enteros, reales, booleanos, texto, fecha, null u objeto. Si el valor es un objeto, puede tener las siguientes propiedades:
Propiedad | Tipo | Descripción |
---|---|---|
value | Integer, Real, Boolean, Text, Date, Null | Valor de la celda (excepto - time) |
time | Real | Valor hora (en segundos) |
Ejemplo
$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)
Ver también
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)
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro | |
optionObj | Object | -> | Objeto que contiene las opciones del libro de trabajo a definir |
Descripción
VP SET WORKBOOK OPTIONS
sets the workbook options in vpAreaName.
En vpAreaName, pase el nombre del área 4D View Pro.
In optionObj, pass the workbook options to apply to vpAreaName.
If optionObj is empty, the command does nothing.
Las opciones modificadas del libro de trabajo se guardan con el documento.
En la siguiente tabla se listan las opciones de libros de trabajo disponibles:
Propiedad | Tipo | Descripción | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
allowUserDragMerge | boolean | Se permite la operación de fusión por arrastre (seleccionar celdas y arrastrar la selección para fusionar celdas) | |||||||||||||||||||||
allowAutoCreateHyperlink | boolean | Permite la creación automática de hipervínculos en la hoja de cálculo. | |||||||||||||||||||||
allowContextMenu | boolean | Se puede abrir el menú contextual integrado. | |||||||||||||||||||||
allowCopyPasteExcelStyle | boolean | Los estilos de una hoja de cálculo pueden copiarse y pegarse en Excel, y viceversa. | |||||||||||||||||||||
allowDynamicArray | boolean | Permite arrays dinámicos en hojas de cálculo | |||||||||||||||||||||
allowExtendPasteRange | boolean | Amplía el rango pegado si éste no es suficiente para los datos pegados | |||||||||||||||||||||
allowSheetReorder | boolean | Se permite reordenar la hoja | |||||||||||||||||||||
allowUndo | boolean | Deshacer ediciones está permitido. | |||||||||||||||||||||
allowUserDeselect | boolean | Se permite desmarcar celdas específicas de una selección. | |||||||||||||||||||||
allowUserDragDrop | boolean | Se permite arrastrar y soltar los datos del rango | |||||||||||||||||||||
allowUserDragFill | boolean | Se permite el relleno por arrastre | |||||||||||||||||||||
allowUserEditFormula | boolean | Las fórmulas pueden introducirse en las celdas | |||||||||||||||||||||
allowUserResize | boolean | Columnas y filas redimensionables | |||||||||||||||||||||
allowUserZoom | boolean | Se permite hacer zoom (ctrl + rueda del ratón) | |||||||||||||||||||||
autoFitType | number | El contenido se formatea para que se ajuste en las celdas, o en las celdas y los encabezados. Available values:
| |||||||||||||||||||||
backColor | string | Una cadena de color utilizada para representar el color de fondo del área, como "red", "#FFFF00", "rgb(255,0,0)", "Acento 5". El color de fondo inicial se oculta cuando se define una backgroundImage. | |||||||||||||||||||||
backgroundImage | string / picture / file | Imagen de fondo para el área. | |||||||||||||||||||||
backgroundImageLayout | number | Cómo se muestra la imagen de fondo. Available values:
| |||||||||||||||||||||
calcOnDemand | boolean | Las fórmulas se calculan sólo cuando se piden. | |||||||||||||||||||||
columnResizeMode | number | Redimensiona modo para columnas. Available values:
| |||||||||||||||||||||
copyPasteHeaderOptions | number | Encabezados para incluir cuando se copian o pegan datos. Available values:
| |||||||||||||||||||||
customList | collection | La lista para que los usuarios personalicen el relleno de arrastre, dar prioridad a que coincida con esta lista en cada relleno. Cada elemento de colección es una colección de cadenas. See on SpreadJS docs. | |||||||||||||||||||||
cutCopyIndicatorBorderColor | string | Color del borde del indicador que aparece cuando el usuario corta o copia la selección. | |||||||||||||||||||||
cutCopyIndicatorVisible | boolean | Muestra un indicador al copiar o cortar el elemento seleccionado. | |||||||||||||||||||||
defaultDragFillType | number | El tipo de relleno de arrastre por defecto. Available values :
| |||||||||||||||||||||
enableAccessibility | boolean | El soporte de accesibilidad está activado en la hoja de cálculo. | |||||||||||||||||||||
enableFormulaTextbox | boolean | Se activa la caja de texto de la fórmula. | |||||||||||||||||||||
grayAreaBackColor | string | Una cadena color utilizada para representar el color de fondo del área gris, como "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", etc. | |||||||||||||||||||||
highlightInvalidData | boolean | Los datos inválidos son resaltados. | |||||||||||||||||||||
iterativeCalculation | boolean | Activa el cálculo iterativo. See on SpreadJS docs. | |||||||||||||||||||||
iterativeCalculationMaximumChange | numeric | Cantidad máxima de cambio entre dos valores de cálculo. | |||||||||||||||||||||
iterativeCalculationMaximumIterations | numeric | Número de veces que la fórmula debe recalcular. | |||||||||||||||||||||
newTabVisible | boolean | Mostrar una pestaña especial para permitir a los usuarios insertar nuevas hojas. | |||||||||||||||||||||
numbersFitMode | number | Cambia el modo de visualización cuando el ancho de los datos de fecha/número es mayor que el ancho de la columna. Available values:
| |||||||||||||||||||||
pasteSkipInvisibleRange | boolean | Paste or skip pasting data in invisible ranges:
| |||||||||||||||||||||
referenceStyle | number | Estilo para referencias de celdas y rangos en fórmulas de celdas. Available values:
| |||||||||||||||||||||
resizeZeroIndicator | number | Política de dibujo cuando las líneas o columnas se redimensionan a 0. Available values:
| |||||||||||||||||||||
rowResizeMode | number | La forma en que se redimensionan las líneas. Los valores disponibles son los mismos qe columnResizeMode | |||||||||||||||||||||
scrollbarAppearance | number | Apariencia de la barra de desplazamiento. Available values:
| |||||||||||||||||||||
scrollbarMaxAlign | boolean | La barra de desplazamiento se alinea con la última línea y columna de la hoja activa. | |||||||||||||||||||||
scrollbarShowMax | boolean | Las barras de desplazamiento mostradas se basan en el número total de columnas y líneas de la hoja. | |||||||||||||||||||||
scrollByPixel | boolean | Activar desplazamiento de precisión por píxel. | |||||||||||||||||||||
scrollIgnoreHidden | boolean | La barra de desplazamiento ignora líneas o columnas ocultas. | |||||||||||||||||||||
scrollPixel | integer | Decide el desplazamiento por ese número de píxeles cuando scrollByPixel es true. The final scrolling pixels are the result of scrolling delta * scrollPixel . Por ejemplo: delta de desplazamiento es 3, scrollPixel es 5, los píxeles finales de desplazamiento son 15. | |||||||||||||||||||||
showDragDropTip | boolean | Mostrar la punta de arrastrar y soltar. | |||||||||||||||||||||
showDragFillSmartTag | boolean | Mostrar el diálogo de arrastrar y rellenar. | |||||||||||||||||||||
showDragFillTip | boolean | Mostrar la punta de arrastrar y soltar. | |||||||||||||||||||||
showHorizontalScrollbar | boolean | Mostrar la barra de desplazamiento horizontal. | |||||||||||||||||||||
showResizeTip | number | Cómo mostrar el tip de redimensionamiento. Available values:
| |||||||||||||||||||||
showScrollTip | number | Cómo mostrar el tip de desplazamiento. Available values:
| |||||||||||||||||||||
showVerticalScrollbar | boolean | Mostrar la barra de desplazamiento vertical. | |||||||||||||||||||||
tabEditable | boolean | La pestaña de la hoja se puede editar. | |||||||||||||||||||||
tabNavigationVisible | boolean | Mostrar la navegación por pestañas. | |||||||||||||||||||||
tabStripPosition | number | Posición de la barra de pestañas. Available values:
| |||||||||||||||||||||
tabStripRatio | number | Valor porcentual (0,x) que especifica qué parte del espacio horizontal se asignará al tabulador. El resto del área horizontal (1 - 0.x) se asignará a la barra de desplazamiento horizontal. | |||||||||||||||||||||
tabStripVisible | boolean | Mostrar la barra de pestañas de la hoja. | |||||||||||||||||||||
tabStripWidth | number | Ancho de la etiqueta cuando la posición es izquierda o derecha. Por defecto y el mínimo es 80. | |||||||||||||||||||||
useTouchLayout | boolean | Si se va a utilizar el diseño táctil para presentar el componente Spread. |
Ejemplo
Para definir la opción allowExtendpasteRange en "ViewProArea":
var $workbookOptions : Object
$workbookOptions:= New Object
$workbookOptions.allowExtendPasteRange:=True
VP SET WORKBOOK OPTIONS("ViewProArea";$workbookOptions)
Ver también
VP SHOW CELL
VP SHOW CELL ( rangeObj : Object { ; vPos : Integer; hPos : Integer } )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto rango | |
vPos | Integer | -> | Posición vertical de la vista de la celda o de la línea | |
hPos | Integer | -> | Posición horizontal de la vista de la celda o de la línea |
Descripción
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.
Los siguientes selectores están disponibles:
Selector | Descripción | Disponible con vPos | Disponible con hPos |
---|---|---|---|
vk position bottom | Alineación vertical a la parte inferior de la celda o de la línea. | X | |
vk position center | Alineación al centro. The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position left | Alineación horizontal a la izquierda de la celda o columna | X | |
vk position nearest | Alineación al límite más cercano (arriba, abajo, izquierda, derecha, centro). The alignment will be to the cell, row, or column limit according to the view position indicated: | X | X |
vk position right | Alineación horizontal a la derecha de la celda o de la columna | X | |
vk position top | Alineación vertical a la parte superior de la celda o de la línea | X |
Este comando sólo es eficaz si es posible reposicionar la vista. 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 vista permanece inalterada.
Ejemplo
Quiere ver la celda en la columna AY, línea 51 en el centro del área 4D View Pro:
$displayCell:=VP Cell("myVPArea";50;50)
// Mover la vista para mostrar la celda
VP SHOW CELL($displayCell;vk position center;vk position center)
Resultado:
El mismo código con los selectores vertical y horizontal cambiados para mostrar la misma celda posicionada en la parte superior derecha del área 4D View Pro:
$displayCell:=VP Cell("myVPArea";50;50)
// Mover la vista para mostrar la celda
VP SHOW CELL($displayCell;vk position top;vk position right)
Resultado:
Ver también
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 )
Parámetros | Tipo | Descripción | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
Descripción
The VP SUSPEND COMPUTING
command stops the calculation of all formulas in vpAreaName. Este comando es útil cuando se desea suspender los cálculos en esta área 4D View Pro para poder realizar manualmente modificaciones en las fórmulas sin encontrar errores antes de terminar de hacer los cambios.
El comando pausa los cálculos en 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.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
El servicio de cálculo de 4D View Pro mantiene un contador de acciones de suspensión/reanudación. Therefore, each execution of
VP SUSPEND COMPUTING
command must be balanced by a corresponding execution of theVP RESUME COMPUTING
command. Toda fórmula afectada por las modificaciones realizadas mientras los cálculos están suspendidos será recalculada cuando se ejecute el comando.
Ejemplo
Ha añadido dos botones al formulario para que el usuario pueda suspender/reanudar los cálculos:
El código del botón 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