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 / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Tabla dinámica
  • Overview
  • Manipulating Pivot Table controls programmatically
  • Coloring the values
  • Adding a column or row title
  • Making a value invisible
  • Finding out and modifying the mask used to display values
  • Modifying the axes displayed
  • Modifying the data source
  • Progreso del cálculo
  • Properties specific to Pivot Table controls
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
Manipulating Pivot Table controls programmatically
Overview
A Pivot Table control can be handled programmatically.
To manipulate a Pivot Table control through programming, WINDEV proposes the PVT functions.
This help page explains how to programmatically manipulate Pivot Table controls.
Manipulating Pivot Table controls programmatically

Coloring the values

From the context menu of the Pivot Table control, the end user can easily color a value in order to highlight it. For more details, see Automatic features of Pivot Table controls.
Through programming, you have the ability to access the values in order to modify their style (text or background color, ...). To do so, modify the properties of values in the "Cell display" event.
For example:
// Si le CA est inférieur à 500, affiche la valeur en rouge
IF VAL_CA <= 500 THEN
	VAL_CA.CouleurFond = PastelRed
END
Note: You can customize the style of each cell element: color, font, background color, etc., using a number of properties.. For more details, see Properties associated with the values of a Pivot Table control.

Adding a column or row title

By default, the rows or columns of a Pivot Table control have no title. You can add one using the Caption property the header name.
For example:
  • Pivot Table not displaying a title:
  • Pivot Table with a title:
The following code is used:
// Initialisation de TCD_Stats
COL_Continent.Libellé = "Continent"
COL_Pays.Libellé = "Pays"
COL_Type_Véhicule.Libellé = "Véhicule"
COL_DateCommande_Année.Libellé = "Année"
COL_DateCommande_Trimestre.Libellé = "Trimestre"
COL_DateCommande_Mois.Libellé = "Mois"

Making a value invisible

By default, all the values of a Pivot Table are displayed. In some cases, it may be interesting to calculate the values but not to display them. The values exist in the Pivot Table control and they can be used to perform a calculation or to fill a chart for example, ...
To hide a value, simply use the Visible property.
Example: A Pivot Table displays in each cell the turnover and the quantity sold. A chart is built from the quantity sold and this quantity must not be displayed in the Pivot Table control. To do so, use the following line of code in the initialization code of the Pivot Table control:
VAL_Qté.Visible = False

Finding out and modifying the mask used to display values

To get and set the type displayed for a value in a Pivot Table control, use the InputType property. You can use the following syntax:
{{"Nom Valeur"}}..TypeSaisie = typSaisieDurée
or:
NomValeur.TypeSaisie = typSaisieDurée

Modifying the axes displayed

You have the ability to modify the axes displayed or to reverse the rows and columns with PVTAxisXY.
Example:
// Modifie les lignes et les colonnes affichées
PVTAxisXY(TCD_Stats, "COL_Année" + CR + "COL_Trimestre", "COL_TypeVéhicule" + CR + "COL_Modèle")

Modifying the data source

You also have the ability to modify the data source of a Pivot Table control via BrowsedFile.
Example:
// Modifie les lignes et les colonnes affichées
TCD_Stats.FichierParcouru = Stat2015
Caution:
  • If the Pivot Table control is based on a data file, the new source data file must have the same structure as the file used when creating the control.
  • If the Pivot Table control is based on an array of structures:
    • the new source array of structures must have the same structure as the variable used when creating the control.
    • the name of the new structure must be preceded by ":". For example:
      TCD_Stats.FichierParcouru = ":MaNouvelleStructure"

Progreso del cálculo

  • Se muestra una barra de progreso durante el cálculo del control Tabla dinámica.
  • El usuario tiene la posibilidad de cancelar el cálculo mediante un botón "Cancelar"..
    Para saber si el cálculo se ha realizado completamente, utilice la variable ErrorOccurred..
    Ejemplo:
    PROCEDURE Load_PVT()
     
    PVTCalculateAll(PVT_Statistics)
    IF ErrorOccurred = True THEN
    SWITCH Dialog("Do you want to cancel the current process?")
    // Cancel
    CASE 1
    Close()
    // Continue
    CASE 0
    Load_PVT()
    END
    END

Properties specific to Pivot Table controls

The following properties are used to manage Pivot Table controls:
AutoLineWrapLa propiedad AutoLineWrap se utiliza para:
  • determina si el ajuste de línea automático está activado en un control multilínea Edit, en una columna de un control Table o TreeView o en una cabecera de fila de un control Tabla dinámica..
  • establece el modo de ajuste de línea en un control Edición multilínea, en una columna de un control Tabla o TreeView o en una cabecera de fila de un control Tabla dinámica.
CumulatedLa propiedad Cumulated permite saber si el valor de una columna o fila de un control Tabla dinámica corresponde a un total (total al final de una fila o columna).
DisplayOrphanLa propiedad DisplayOrphan permite:
  • Determinar si una fila o columna en un control Tabla dinámica se muestra cuando no tiene padre.
  • Cambiar el modo de visualización de una fila o una columna en un control Tabla dinámica cuando no tiene padre.
FilterProcedureThe FilterProcedure property allows you to get and modify the procedure used to apply a filter on a row or column header when calculating a Pivot Table control.
ProgressBarThe ProgressBar property is used to identify and change the Progress Bar control used when calculating a Pivot Table control (PVTCalculateAll and PVTCalculateUpdate functions).
For a complete list of WLanguage properties that can be used with Pivot Table controls, see Pivot Table control properties.
Versión mínima requerida
  • Versión 18
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/09/2024

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