AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Tabla dinámica
  • Properties specific to pvtPosition variables
  • Operating mode
  • Case of pivot tables with filter
  • Modifying the characteristics of a cell
  • Functions that use pvtPosition variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The pvtPosition type is used to handle a cell of a Pivot Table control. This type of variable is mainly used to retrieve the value found in a cell or to modify the characteristics of the cell (the background color for example).
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Ejemplo
// Declaration
x is pvtPosition of PVT_Sales
// Specify the values of the cell headers 
x.Year = "2020"
x.Quarter = "2020Q1"
x.Month = "202001"
x.Product.Cumulated = True 
// Display the total of sales for all the products in January 2020
STC_Result = PVT_Sales.Value1[x]
Propiedades

Properties specific to pvtPosition variables

The following properties can be used to define the characteristics of pvtPosition variables:
Property nameType usedEffect
OutBoolean
  • True if the specified position is outside the pivot table.
  • False if the position is valid.
This property is read-only.
This property is used to find out whether the position specified by PVTInfoXY exists.
Observaciones

Operating mode

To handle a pvtPosition variable, you must:
  • specify the values of headers for the desired cell. For example:
    MyPosition is pvtPosition of PVT_Statistics
    // Indicate the headers
    MyPosition.COL_Continent = "Europe"
    MyPosition.COL_OrderDate_Year = "2012"
  • access a value of the pivot table via the following syntax:
    <Name of pivot table>.<Value name>[<pvtPosition variable>]

    For example:
    // Retrieves the "VAL_Qty" value
    nQuantity = PVT_Statistics.VAL_Qty[MyPosition]
Remarks:
  • If the position does not correspond to a displayed cell (because the cell is collapsed for example), you cannot retrieve the value of the cell or modify its color.
  • If the position does not correspond to a value that exists in the result (a product that was not sold this particular day for example), the returned value is 0.
  • If the position has a header name that does not exist in the pivot table, a WLanguage error is displayed.
  • A WLanguage error occurs if the position is outside the pivot table.
  • To get a cumulated total on a header, specify no header or set .Cumulated to True.
  • The .Out property can be used to determine if the position returned by PVTInfoXY exists.

Case of pivot tables with filter

Variables of type tcdPosition variables manipulate the entire crosstab array: non-displayed data are also taken into account. When using filters (PVTFilter), this filter must be declared in the pvtPosition variable.
Example:
MyPosition is pvtPosition of PVT_Statistics
// Indicates the filter
MyPosition.COL_FILTER_Product = COMBO_Product
// Indicate the headers
MyPosition.COL_Continent = "Europe"
MyPosition.COL_OrderDate_Year = "2012"
// Retrieves the "VAL_Qty" value
nQuantity = PVT_Statistics.VAL_Qty[MyPosition]

Modifying the characteristics of a cell

To highlight a cell on the display (maximum, minimum value, etc.), you can use a variable of type tcdPosition variable..
Example:
MyPosition is pvtPosition of PVT_Statistics

// Indicate the headers
MyPosition.COL_Continent = "Europe"
MyPosition.COL_OrderDate_Year = "2012"

// Modifies the background color of the "VAL_Qty" value
VAL_Qty[MyPosition].BackgroundColor = LightRed

Functions that use pvtPosition variables

PVTInfoXYDevuelve los valores de las cabeceras correspondientes a una posición en un control Tabla dinámica en píxeles.
PVTListPositionHeaderReturns all values associated with a row or column header in a Pivot Table control.
PVTSelectPermite conocer la posición de las celdas seleccionadas y seleccionar celdas en un control Tabla dinámica.
Versión mínima requerida
  • Versión 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local