PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • How to create the Pivot Table control (in a window)?
  • Wizard for creating a Pivot Table control
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
How to create the Pivot Table control (in a window)?
To create a Pivot Table control in a window:
  1. On the "Creation" pane, in the "Data" group, expand "Table and list box" and select "Pivot table (PVT)".
  2. Click the position where the control will be created in the window. The wizard for control creation starts. This wizard is used to define the main elements of the pivot table.
  3. At the end of the wizard, the Pivot Table control is automatically created with the Button control used ti fill it at runtime.
Notes:
  • The Pivot Table control works:
    • on the HFSQL databases,
    • Versions 20 and later
      on other databases via arrays of structures.
      New in version 20
      on other databases via arrays of structures.
      on other databases via arrays of structures.
  • Versions 21 and later
    The content of the Pivot Table control can be printed via its popup menu. See Printing the content of a Pivot Table control (AAF) for more details.
    New in version 21
    The content of the Pivot Table control can be printed via its popup menu. See Printing the content of a Pivot Table control (AAF) for more details.
    The content of the Pivot Table control can be printed via its popup menu. See Printing the content of a Pivot Table control (AAF) for more details.
  • Versions 21 and later
    You can create a report based on a Pivot Table control. See Pivot Table report for more details.
    New in version 21
    You can create a report based on a Pivot Table control. See Pivot Table report for more details.
    You can create a report based on a Pivot Table control. See Pivot Table report for more details.
Wizard for creating a Pivot Table control
The Pivot table control creation wizard is used to define the main elements of the table.
  1. First, the wizard is used to define the values displayed in the cells of the pivot table. A cell found in a pivot table can display for example the total sales, the sum of quantities, the number of orders, ...
    Therefore, you must define for each value displayed in the cell:
    • the source file. This file corresponds to the file containing the value used for the calculation. For example, the OrdLine file to calculate the sales performed.
    • the calculation displayed. Several calculations are available: sum, mean, count, ...
    • the source for the calculation, which means the item of the source file to use. For example, to calculate the sales performed, the sum will be performed on the sale price (Total_Row item of OrdLine file).
      The "Add an additional value" button is used to define a new value that will be displayed in the cell.
      Notes:
      • The Pivot Table control can be based on a query. In this case, the source file corresponds to the query.
      • Versions 20 and later
        The Pivot Table control can be based on an Array of Structures variable. In this case, the source file corresponds to the variable.
        New in version 20
        The Pivot Table control can be based on an Array of Structures variable. In this case, the source file corresponds to the variable.
        The Pivot Table control can be based on an Array of Structures variable. In this case, the source file corresponds to the variable.
  2. The next step consists in defining the column header of the Pivot Table control. The column header comes firectly from your data files.
    One or more column headers can be found.
    For each column header, the header lets you define:
    • the link used to access the item displayed in the header. This link is performed from the data file used for the source of calculation.
    • if the column header corresponds to a Date item, the wizard proposes the display mode of the date: Year, Half-year, Quarter, Month, Fortnight, Day. A new grouping will be performed for each selected display mode. For example, if only the years, trimesters and months are displayed, the column header will be: if the column header corresponds to a Date item, the wizard proposes the display mode of the date: Year, Half-year, Quarter, Month, Fortnight, Week, Day. A new grouping will be performed for each selected display mode. For example, if only the years, trimesters and months are displayed, the column header will be:
      Notes:
      • If the Pivot Table control is based on a query, the data displayed in the column header comes directly from the query.
      • Versions 20 and later
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the column header comes from the members of the structure.
        New in version 20
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the column header comes from the members of the structure.
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the column header comes from the members of the structure.
  3. The next step consists in defining the row header of the Pivot Table control. The row header comes from your data files.
    One or more row headers can be found.
    For each row header, the wizard lets you define:
    • the link used to access the item displayed in the header. This link is performed from the data file used for the source of calculation.
    • if the row header corresponds to a Date item, the wizard proposes the display mode of the date: Year, Half-year, Quarter, Month, Fortnight, Day. A new grouping will be performed for each selected display mode.if the row header corresponds to a Date item, the wizard proposes the display mode of the date: Year, Half-year, Quarter, Month, Fortnight, Week, Day. A new grouping will be performed for each selected display mode.
      Notes:
      • If the Pivot Table control is based on a query, the data displayed in the row header comes directly from the query.
      • Versions 20 and later
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the row header comes from the members of the structure.
        New in version 20
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the row header comes from the members of the structure.
        If the Pivot Table control is based on an Array of Structures variable, the data displayed in the row header comes from the members of the structure.
  4. Give a name to the Pivot Table control and validate.
    Versions 20 and later
    Note: The dimensions of created control are optimized in order to occupy the available space at the specified position. If the control size does not suit you, press Ctrl + Z: the default control size will be restored.
    New in version 20
    Note: The dimensions of created control are optimized in order to occupy the available space at the specified position. If the control size does not suit you, press Ctrl + Z: the default control size will be restored.
    Note: The dimensions of created control are optimized in order to occupy the available space at the specified position. If the control size does not suit you, press Ctrl + Z: the default control size will be restored.
The Pivot Table control is created in the window with a "Calculate" Button control. This Button control is used to start the calculation of the Pivot Table control.
Caution: If the source of the Pivot Table control is:
  • a query, the query must be run before calculating the Pivot Table control.
  • Versions 20 and later
    an array of structures, the array of structures must be filled before calculating the Pivot Table control.
    New in version 20
    an array of structures, the array of structures must be filled before calculating the Pivot Table control.
    an array of structures, the array of structures must be filled before calculating the Pivot Table control.
To modify the characteristics of the Pivot table control, display the control description ("Description" from the popup menu). See Describing a Pivot Table control for more details.
Related Examples:
WD PivotTable Training (WINDEV): WD PivotTable
[ + ] This example presents the use of the Pivot Table control.

This Pivot Table control is used to display dynamic statistics while grouping the data.
These statistics are calculated form the database.
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment