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

How we can SubTotal Percent

2 Answers 115 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Abdullah
Top achievements
Rank 1
Abdullah asked on 26 Nov 2013, 10:32 AM
Hi everybody,

I want see sub total percent according to sub total.

how can i calculate sub total's items percent according to sub total.

In this picture true calculating

http://t1311.hizliresim.com/1h/u/uwq44.gif

 NeedDataSource Code
(
var aktifler = from bs in PredicaFinansContext.APV_PRE_BILANCO_SIRKET
                           where bs.Yil == yil && bs.Donem == donem && bs.Ay == ay &&
                                   (bs.Tur.StartsWith("AKTİF") || bs.Tur.StartsWith("aktif"))
                           select new
                           {
                               //bs.Sirket,
                               bs.Anakod,
                               bs.Tur,
                               bs.GrupKod,
                               bs.Donem,
                               bs.Yil,
                               bs.Tutar
                           };

            RadPivotGrid1.DataSource = aktifler.ToList();

)

(
<telerik:RadPivotGrid runat="server" ID="RadPivotGrid1"
                        AllowFiltering="true" 
                        OnNeedDataSource="RadPivotGrid1_NeedDataSource" OnPivotGridBiffExporting="RadPivotGrid1_PivotGridBiffExporting" 
                        OnPivotGridCellExporting="RadPivotGrid1_PivotGridCellExporting" OnCellDataBound="RadPivotGrid1_CellDataBound"

                        EnableZoneContextMenu="true" AllowSorting="true" AllowPaging="False" 
                        EmptyValue="0"
                        
                        ColumnHeaderZoneText="Kolon Alanı" DataHeaderZoneText="Data Alanı" FilterHeaderZoneText="Filtre Alanı"
                        RowHeaderZoneText="Satır Alanı"

                        EnableToolTips="True" Width="100%" Height="500px"
                        TotalsSettings-ColumnGrandTotalsPosition="None"
                        TotalsSettings-ColumnsSubTotalsPosition="None"
                        TotalsSettings-RowGrandTotalsPosition="None"
                        TotalsSettings-RowsSubTotalsPosition="Last"
                        Culture="tr-TR" ErrorValue="#" Font-Bold="False"
                        ShowColumnHeaderZone="False"
                        ShowDataHeaderZone="False"
                        ShowFilterHeaderZone="False"
                        ShowRowHeaderZone="False" >
                        <%--<ColumnHeaderCellStyle Width="100px" />--%>
                        <%--<RowHeaderCellStyle Width="150px"></RowHeaderCellStyle>--%>

                        <ClientSettings EnableFieldsDragDrop="true">
                            <ClientEvents OnToolTipShow="toolTipShow" />
                            <Scrolling AllowVerticalScroll="true" />
                        </ClientSettings>


                        <Fields>
                            <telerik:PivotGridReportFilterField DataField="GrupKod" IsHidden="True">
                            </telerik:PivotGridReportFilterField>

                            <telerik:PivotGridRowField DataField="Sirket">
                            </telerik:PivotGridRowField>
                            <telerik:PivotGridRowField DataField="Tur">
                            </telerik:PivotGridRowField>
                            <telerik:PivotGridRowField DataField="Anakod">
                            </telerik:PivotGridRowField>
                            <telerik:PivotGridRowField DataField="GrupKod">
                            </telerik:PivotGridRowField>

                            <%-- HESAPLI ALANLAR --%>
                            <telerik:PivotGridAggregateField Aggregate="Sum" DataField="Tutar" DataFormatString="{0:#,##0} TL" Caption="Tutar">
                                <HeaderCellTemplate>
                                    <asp:Label ID="Label1" runat="server" >
                                        Tutar
                                    </asp:Label>
                                </HeaderCellTemplate>
                                
                            </telerik:PivotGridAggregateField>

                            <%-- GRUB YUZDE --%>
                            <telerik:PivotGridAggregateField Aggregate="Sum" DataField="Tutar" Caption="Grub Yüzde" GrandTotalAggregateFormatString="{0:P}" TotalFormatString="{0:P}">
                                <TotalFormat TotalFunction="PercentOfRowTotal" Axis="Columns"  />
                                <HeaderCellTemplate>
                                    <asp:Label ID="Label1" runat="server" Text="Grub %"></asp:Label>
                                </HeaderCellTemplate>
                                <RowGrandTotalCellTemplate>
                                    <asp:Label ID="Label1" runat="server" Text="RowGrandTotalCellTemplate"></asp:Label>
                                </RowGrandTotalCellTemplate>
                            </telerik:PivotGridAggregateField>
                            
                            <%-- GENEL YÜZDE --%>
                            <telerik:PivotGridAggregateField Aggregate="Sum" DataField="Tutar" Caption="Genel Yüzde" GrandTotalAggregateFormatString="{0:P}" TotalFormatString="{0:P}">
                                <TotalFormat TotalFunction="PercentOfGrandTotal" Axis="Columns" Level="0" />
                                <HeaderCellTemplate>
                                    <asp:Label ID="Label1" runat="server" Text="Genel %"></asp:Label>
                                </HeaderCellTemplate>
                                
                            </telerik:PivotGridAggregateField>
                        </Fields>
                        <ClientSettings EnableFieldsDragDrop="true">
                            <ClientMessages DragToReorder="Sürükle Bırak Alanı"></ClientMessages>
                        </ClientSettings>
                    </telerik:RadPivotGrid>
)

2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 28 Nov 2013, 11:43 AM
Hello Abdullah,

From our next release we will provide functionality for calculated fields and items.
But with the current version, your requirements can not be fully implemented.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Abdullah
Top achievements
Rank 1
answered on 28 Nov 2013, 02:29 PM
Thanks for reply.

I wait the next release..

You can get ideas excel 2013 pivotgrid.

Tags
PivotGrid
Asked by
Abdullah
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Abdullah
Top achievements
Rank 1
Share this question
or