This is a migrated thread and some comments may be shown as answers.

Configuring the PivotGrid to combine certain columns, and leave others as is

2 Answers 44 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Francois
Top achievements
Rank 1
Francois asked on 16 May 2014, 01:56 PM
Hi Telerik,

I'm trying to achive something like in the PivotGrid_ExcelBase image. There you can see the years (2012, 2013) columns with both personen and bedrag columns underneath.

Currently I tried to achieve that with the following code:

01.<Fields>
02. <telerik:PivotGridRowField DataField="SoortIndicatie" UniqueName="SoortIndicatieColumn" Caption="Soort Indicatie" >
03. </telerik:PivotGridRowField>
04. <telerik:PivotGridRowField DataField="SoortVerzilverd" UniqueName="SoortVerzilverdColumn" Caption="Soort Verzilverd">
05. </telerik:PivotGridRowField>
06. 
07. <telerik:PivotGridColumnField DataField="Jaar" UniqueName="JaarColumn" Caption="Jaar">
08. </telerik:PivotGridColumnField>
09. <telerik:PivotGridColumnField DataField="Personen" UniqueName="PersonenColumn" Caption="Personen">
10. </telerik:PivotGridColumnField>
11. <telerik:PivotGridColumnField DataField="Bedrag" UniqueName="BedragColumn" Caption="Bedrag">
12. </telerik:PivotGridColumnField>
13.</Fields>

This shows me a grid as depicted in the PivotGrid_Rendered image. The person and budget columns are also grouped, that's not what I want.
How can I configure this?

Can you tell me how to do so? 

Best regards,
Francois

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 21 May 2014, 10:52 AM
Hi,

I would suggest you to review the online demo below where the years and the ship country fields represents the year and the personen/bedgar fields ion your case.

http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/configurationpanel/defaultcs.aspx#

You could use the configuration panel to modify the columns and the row fields so that you will be able to see what is the exact configuration needed ion your case.


Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Francois
Top achievements
Rank 1
answered on 22 May 2014, 02:18 PM
It should be done like follows:
<Fields>
   <telerik:PivotGridRowField DataField="SoortIndicatie" UniqueName="SoortIndicatieColumn" Caption="Soort Indicatie">
   </telerik:PivotGridRowField>
   <telerik:PivotGridRowField DataField="SoortVerzilverd" UniqueName="SoortVerzilverdColumn" Caption="Soort Verzilverd">
   </telerik:PivotGridRowField>
 
   <telerik:PivotGridColumnField DataField="Jaar" UniqueName="JaarColumn" Caption="Jaar">
    </telerik:PivotGridColumnField>
                 
    <telerik:PivotGridAggregateField DataField="Personen" Aggregate="Sum" UniqueName="PersonenColumn" Caption="Personen">                   
    </telerik:PivotGridAggregateField>
    <telerik:PivotGridAggregateField DataField="Bedrag" Aggregate="Sum" UniqueName="BedragColumn" Caption="Bedrag" DataFormatString="{0:C}">
    </telerik:PivotGridAggregateField>
</Fields>

Please note that you should NOT use AggregatesLevel="0" in the properties of the pivotgrid. this will present you witha null reference exception.

Tags
PivotGrid
Asked by
Francois
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Francois
Top achievements
Rank 1
Share this question
or