FlexPivot for WPF | ComponentOne
Data Blending / Subtotals
In This Topic
    Subtotals
    In This Topic

    FlexPivot control allows users to display subtotals using various aggregate functions such as Sum, Count, Average, etc. 

     

    This can either be done at runtime through the Field Settings dialog, or in code as described in the following sections.

    Calculate Subtotals at Runtime

    1. Right-click the field in the Values area of the FlexPivotPanel control and select Field Settings option.
    2. Click the Subtotals tab and select the type of aggregate function you want to apply.
      Displaying Fields Setting Dialog
    3. Click OK and observe the change in the values.

    Calculate Subtotals Programmatically

    You can use the Subtotal property to calculate subtotals programmatically, as shown in the following code. This implementation uses the sample created in Quick Start topic.

    C#
    Copy Code
    //Apply average subtotal to ExtendedPrice column
    fpEngine.Fields["ExtendedPrice"].Subtotal = Subtotal.Average;