Skip to main content

TcxCustomPivotGrid Class

The base class for Pivot Grid controls.

Declaration

TcxCustomPivotGrid = class(
    TcxControl,
    IcxFilterControl,
    IcxLockedStateFontChanged,
    IcxLockedStatePaint,
    IcxNavigator,
    IcxPivotGridDesignerIntf,
    IcxStoredObject,
    IcxStoredParent,
    IdxSkinSupport
)

Remarks

The type of the pivot grid to be used depends on the data mode it works in. The shipped pivot grid controls are of the two types – TcxDBPivotGrid and TcxPivotGrid.

The base class provides implementation common to subclasses such as options, information on the allocated fields, the layout data, information on images and field groups used in the controls.

The implemented functionality allows descendants to persist the layout scheme in different sources, lock the pivot grid for bulk updates, copy the data to the clipboard, and provides entry points for custom behavior when painting the various elements of the pivot grid, comparing the field’s values or manipulating the fields.

Basics

You can quickly change orientation of the field from column to row, line up fields in a particular header area, so the values of those fields are arranged in the related area into a hierarchical tree. Thus the logically related data can be organized by categories. Having that tree in your report, you can drill down and up data at different levels. As a result, you perform a deeper data analysis or avoid unnecessary details.

Subtotaling is another way of arranging and summarizing data.

To narrow down the report’s results, you can use filters. Filters can be applied at three levels. First, you can use the prefilter panel. This will affect the entire report. Second, you can drop field onto the filter header area and uncheck values in the field’s drop-down list to be filtered out. This will affect the entire report too. Third, you can filter values of the fields located in areas other than the filter header area areas. Only the unselected items of those fields will be hidden in the view but not involved into the calculations.

The ExpressPivotGrid is capable of working with the data layer of any type. It supports four data access modes that allow you to choose the layer that is the most suitable for solving the current data analysis tasks. The brilliant feature of the ExpressPivotGrid is that it’s organized in the best way to perform a robust data analysis on the multilayered data (a hierarchical tree of tables that have a master-detail relationship). You can create additional non-table calculated fields in the data source containing the summarized results of the data, which come from different tables and are pre-processed with the specified calculations. These results will be then shown in the view and involved into the further calculations in the reports.

Compared to the traditional grid control, the pivot grid requires far less time and efforts in providing solutions to the above tasks.

Hierarchical Value Arrangement

Field values in reports are displayed hierarchically, if two or more fields are located in the drop areas. The hierarchical view of the data allows end-users to analyze a report at different levels. The deeper the hierarchy, the more hierarchical choices for end-users to make data analysis from different perspectives.

The hierarchical view is best fitted for the complex data analysis, if the data in the underlying data source is hierarchical (the tables in that store are in a master-detail relationship) and the data source contains lookup fields. For example, the Orders table may contain a lookup Company Name (a dealer) field and a lookup Car Name. Then dropping these two fields in the row header area will result in the following hierarchy:

In the view you can see the way the data is summarized by the dealer, and each model at a time. The parent grouping values display expand buttons that can be used to switch from the “by dealer” to the “by model” view.

Another way is to apply different levels of details with the same field. You can create two or more view fields and bind them to the same persistent field. For instance, two fields can be bound to the PurchaseDate persistent field (see the OrderReportsDemo that ships with the product). The first field (Year) will group data by years, while the second one (Month) – by months (see the TcxPivotGridField.GroupInterval property):

Note that you can provide custom intervals in addition to the default ones (to do that, set the TcxPivotGridField.GroupInterval property to giCustom and handle the TcxPivotGridField.OnGetGroupValue and TcxPivotGridField.OnGetGroupValueDisplayText events).

See Also