Layouts

RadPivotGrid supports all of the three most widely used report layouts: Tabular, Outline and Compact.

Layout Types

When you create your report with RadPivotGrid you may want to make the data easier for understanding by changing the report layout. With RadPivotGrid you have three different Layouts to format the data in the rows and columns. Each of them can be set separately for Rows and Columns and by combining them you can create many different reports:

  • Compact - with this layout all row headers are in one column and all column headers are in one row. If you have more than one group description in your rows/columns you will notice that there is fixed indent for each group headers. This way there is more space for numeric data:

    Rad Pivot Grid Features Layouts 01

  • Outline - with this layout Row and Column Headers are separated based on their level. The indent depends on the length of the Row Headers and on the height of the Column Headers.

    Rad Pivot Grid Features Layouts 02

  • Tabular - with this layout you will see only one row/column per item. The hierarchy from the other two layouts is "flattened" here.

    Rad Pivot Grid Features Layouts 03

Defining Layout

RadPivotGrid uses two different layouts - horizontal layout(for columns) and vertical layout (for rows). By combining them you can change your generated report to look exactly as you need it. You can set them in your XAML or in code behind:

Example 1: Setting the layout in XAML

<pivot:RadPivotGrid HorizontalLayout="Outline" VerticalLayout="Compact" /> 

Example 2: Setting the layout in code

RadPivotGrid pivot = new RadPivotGrid(); 
pivot.HorizontalLayout = PivotLayoutType.Outline; 
pivot.VerticalLayout = PivotLayoutType.Compact; 
Dim pivot As New RadPivotGrid() 
pivot.HorizontalLayout = PivotLayoutType.Outline 
pivot.VerticalLayout = PivotLayoutType.Compact 

Totals Position

With above mentioned Layouts you can generate different reports and select the best one for your application. But RadPivotGrid gives you the ability to modify it even further. You can select GrandTotals and SubTotals position for both Rows and Columns. You can even remove them if you assess you do not need them. To set the positions you should use the following properties:

  • RowGrandTotalsPosition - defines the position of GrandTotals for all rows. You can choose between three options: Bottom (GrandTotals are shown on the last row), Top (GrandTotals are shown on the first row) or None (GrandTotals are not shown for rows).

  • RowSubTotalsPosition - defines the position of SubTotals for each RowGroupDescription. You can choose between three options: Bottom (SubTotals are shown on the last row for each group), Top (SubTotals are shown on the first row for each group) or None (SubTotals are not shown on the rows).

  • ColumnGrandTotalsPosition - defines the position of GrandTotals for all columns. You can choose between three options: Left (GrandTotals are shown in the first column), Right (GrandTotals are shown in the last column), None (GrandTotals are not show on the columns).

  • ColumnSubTotalsPosition - defines the position of SubTotals for each ColumnGroupDescription. You can choose between three options: Left (SubTotals are shown in the first column for each group), Right (SubTotals are shown in the last column for each group), None (SubTotals are not show on the columns).

Here is RadPivotGrid with the following configuration:

  • HorizontalLayout = "Outline"

  • VerticalLayout = "Compact"

  • ColumnGrandTotalsPosition="Right"

  • ColumnSubTotalsPosition="None"

  • RowGrandTotalsPosition="Bottom"

  • RowSubTotalsPosition="Top"

Rad Pivot Grid Features Layouts 04

Auto Show Subtotals

When you set the RowSubTotalsPosition property of the group description to a value different than None, the pivot renders the subtotals of the corresponding property group. You can alter this and hide the subtotals for a specific group via the AutoShowSubTotals property of the corresponding group description object.

Example 3: Hidding the subtotals in XAML

<pivot:LocalDataSourceProvider.RowGroupDescriptions> 
    <pivot:PropertyGroupDescription PropertyName="Product" /> 
    <pivot:DateTimeGroupDescription PropertyName="Date" Step="Month" AutoShowSubTotals="False"/> 
</pivot:LocalDataSourceProvider.RowGroupDescriptions> 

Example 4: Hidding the subtotals in code

    dataSourceProvider.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "Product" }); 
    dataSourceProvider.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "Date", Step = DateTimeStep.Month, AutoShowSubTotals = false }); 
dataSourceProvider.RowGroupDescriptions.Add(New PropertyGroupDescription() With { .PropertyName = "Product" }) 
dataSourceProvider.RowGroupDescriptions.Add(New DateTimeGroupDescription() With { 
    .PropertyName = "Date", 
    .[Step] = DateTimeStep.Month, 
    .AutoShowSubTotals = False 
}) 

Silverlight RadPivotGrid Hidden Subtotals

The show sub totals option is available also in the context menu of the group descriptions in the RadPivotFieldList control.

Silverlight RadPivotGrid Show Subtotals Pivot Field List Item

See Also

In this article