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

3 posts, 0 answers
  1. Francois
    Francois avatar
    6 posts
    Member since:
    Nov 2013

    Posted 16 May 2014 Link to this post

    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. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 21 May 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Francois
    Francois avatar
    6 posts
    Member since:
    Nov 2013

    Posted 22 May 2014 Link to this post

    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.

Back to Top