We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Completely disable totals calculations in PivotGrid + performance

Hi. I'm using pivot grids and I don't need any kind of total or subtotals calculation. I just need to rearrange dimensions, like

From a starting point:

Country   Food   value
USA     Pizza     1000
USA     Donut     200
Canada     Donut     30
Mexico     Pizza     300

move Food to "columns" and see

Country  Pizza     Donut
USA     1000     200
Canada     blank     30
Mexico     300     blank

I was able to do this using CalculationType =NoCalculation and setting all ShowTotals = false, ShowSubtotals =false and so on.
Still, it is kind of slow when I do that action (about 5 seconds in a high end pc and with just a few data elements), because I guess that although subtotals and totals are not shown, they're still being silently calculated. Is it possible to completely deactivate total and subtotals calculation in order to make the control a little faster?

Also, my datasource will NEVER have more than one value for a given combination of values for the dimensions. In the example above, Country+Food would be a composite primary key. I'm not sure if that precondition could allow me to tune the PivotGrid control in any way to make it faster.

I'm with the WPF version of the control but I could switch to Winforms if you think the that version might be more performant.
Thanks in advance!

3 Replies

AA Arulraj A Syncfusion Team February 21, 2019 07:01 AM

Hi Carlos, 

Thanks for contacting Syncfusion support. 

We have checked your requirement “Display flat data without subtotals in PivotGrid control” in your working version As per the default behavior of PivotGrid, sub-totals for underlying data source will be calculated automatically while populating the values in PivotEngine. Only the subtotals will be ignored from displaying when the grid cells are prepared to render and display. Hence it is necessary to calculate the subtotal to achieve the pivot functionality.  

However we have checked the same in our machine to ensure the performance of our control and we could not see that any performance issue as per your update. We have attached our working sample. Could you please share us your machine configuration where did you get performance issues along with the kind of operation should be performed? 

Please get back to us if you need any further assistance on this. 

Arulraj A 

CF Carlos Fernando Consigli February 23, 2019 04:35 PM

Hello Arulraj, thanks a lot for your answer. I run your sample and it still had a laggy behavior. As you told me that sample run ok on your endpoint, I deduced the problem was in my environment, and it was. Although I was running the app in Release mode and with IU Debug disabled, it seems that Visual Studio 2017 still messes up with the executable while it runs. So I just built the solution and executed it from outside Visual Studio and it actually did run with no performance issues. So that is solved.

In the other hand, still in your sample, I'm losing the values when moving the two dimensions to the column section (I attach a video). Maybe that's expected, I'm not sure. Is it possible to make it render the values in that case?

Again, thanks for your help. I have said this before, but Syncfusion support is outstanding.

Attachment: Field_List__23_2_2019_18_29_55_7efff420.zip

TB Thirupathi Bala Krishnan Syncfusion Team February 25, 2019 08:28 AM

Hi Carlos, 

Thanks for the update. 

We have analyzed your requirement – “Data values are not displayed while drag and drop the fields from row to column”. As per default behavior of pivot grid, only the grand total row is displayed while moving the entire rows into columns. In your application, you  had set the ShowGrandTotal property value as false. Since the data values have not displayed. If you need to display the last row data values, you should enable the ShowGrandTotals property value as true in your application. 

Please refer the following code sample: 


<syncfusion:PivotGridControl x:Name="pivotGrid1" Margin="5" ItemSource="{Binding ProductSalesData}" ShowGrandTotals="True" ShowSubTotals="False"
                    <syncfusion:PivotItem FieldMappingName="Country" FieldHeader="Country" TotalHeader="Total"/>
                    <syncfusion:PivotItem FieldMappingName="Food" FieldHeader="Food" TotalHeader="Total"/>
                    <syncfusion:PivotComputationInfo CalculationName = "Total" FieldName = "Amount" SummaryType="DoubleTotalSum"  CalculationType="NoCalculation"/>

Please let us know if you need any further assistance. 

Thirupathi B. 

Live Chat Icon For mobile
Up arrow icon