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

Pivot Chart Dilldown/Up does not supports Enum type

Pivot Chart Dilldown/Up (https://blazor.syncfusion.com/documentation/pivot-table/pivot-chart#drill-downup ) does not seem to support Enum type.

Repro path:

  1. configure pivot char as so:
  2. 

 



Exception:


Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'hPHRar9PwLwe3so68X1OREUQ9ljX3FB1D8LTTlB12Hc'.


System.InvalidCastException: Unable to cast object of type 'blazor_pivottable.Strategy' to type 'System.String'.

   at Syncfusion.Blazor.PivotView.Internal.PivotChart`1.DrillMenuSelect(MenuEventArgs`1 args)

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location ---

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)



Can you please suggest?

Thx!

Yi


11 Replies

YH Yi Han December 4, 2022 07:21 PM UTC

A side question please:

in terms of aggregation performance, what is difference between Enum type (so underlying int) versus String ?

Thx!



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 5, 2022 03:44 PM UTC

Hi Yi Han,


Please find the response below:


Query

Comments

Pivot Chart Dilldown/Up (https://blazor.syncfusion.com/documentation/pivot-table/pivot-chart#drill-downup ) does not seem to support Enum type.

This was the known issue, and it has now been resolved. Moreover, this issue fix will be available in our upcoming Vol 4 Main release, which is scheduled to be released at December 16, 2022.

A side question please:

in terms of aggregation performance, what is difference between Enum type (so underlying int) versus String ?

In the pivot table, Enum type fields are always treated as string. Since any fields holding values other than those of integer types (such as int, double, and so on) will be considered as count, the aggregation will therefore be set to "Count."


Please let us know if you have any concerns.


Regards,

Angelin Faith Sheeba.



YH Yi Han December 6, 2022 08:45 AM UTC

Hi,


Thanks for your reply.


Can you please elaborate more about: 
 >  In the pivot table, Enum type fields are always treated as string. Since any fields holding values other than those of integer types (such as int, double, and so on) will be considered as count, the aggregation will therefore be set to "Count."


I'm not sure have understood your point- what is "Count" ? 

Thx

Yi



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 7, 2022 12:30 PM UTC

Hi Yi Han,


Aggregation type count for value field will count the number of records in the given data source for each value cells based on rows and columns combination.


Screenshot:



YH Yi Han December 7, 2022 01:34 PM UTC

Hi,


"Count" is a just a type of aggregation right? You have others: sum/average  ....

I don't get you why you are mentioning only "count".


So back to my question regarding performance, all types of aggregation will convert Enum to String before executing the aggregation <-- that's what you are telling me ? 


After your fix of December 16, 2022, you won't do the enum-to-string convert - aggregate on enum as it is ?


Thx 

Yi



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 8, 2022 11:34 AM UTC

Hi Yi Han,


Aggregations for values other than numbers will only support count or distinct count type aggregations. If the value is in integer type, it supports sum, products, and all other built-in aggregation types. However, because you are using Enum type values in the pivot table, it will only support count and distinct count, as we previously stated. It is the standard Excel behavior. We are also following the standard Excel behavior too.


Regards,

Angelin Faith Sheeba



YH Yi Han December 8, 2022 01:15 PM UTC

Hi  AngelinFaithSheeba,


There is some miss understanding here.


The enum type is not aggregated value, but aggregating value.


The issue I was mentioning in the initial thread is this case as below: 

ex: 

aggregating value:  enum Country { France, USA, India, China }

aggregated value:  SalesAmount:: double

we aggregate SalesAmount by Country.


You can reproduce the problem with the code attached.


Please suggest. Thanks.


Yi


Attachment: pivotchartdilldownupdoesnotsupportsenumtype_51315531.zip


AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 9, 2022 08:08 PM UTC

Hi Yi Han,


We have checked the provided sample and we are unable to reproduce any issues while binding enum in rows, columns and values. However, we suspect that you are mentioning that the issue occurs while drill down in pivot chart. If so, we have fixed the issue and the fix will be available in our upcoming Vol 4 main release, which is scheduled to be released on December 16, 2022.


Meanwhile we have attached the video with the fix.


Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/09.12.2022_15.47.31_REC.mp4520332579


If the above information differs from your query, please share the details, including screenshot and video that replicates the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible.



Regards,

Angelin Faith Sheeba.



YH Yi Han December 10, 2022 02:08 PM UTC

Hi,


Thank you for your reply.


Please look carefully at my initial post and the code that I provided, the enum type is on Strategy.  I have provided screenshot - let me repeat it here:



with this, when you drill down in pivot chart by StrategyName, you can reproduce:

Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'hPHRar9PwLwe3so68X1OREUQ9ljX3FB1D8LTTlB12Hc'.


System.InvalidCastException: Unable to cast object of type 'blazor_pivottable.Strategy' to type 'System.String'.

   at Syncfusion.Blazor.PivotView.Internal.PivotChart`1.DrillMenuSelect(MenuEventArgs`1 args)

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)


Thanks,

Yi






SP Sastha Prathap Selvamoorthy Syncfusion Team replied to Yi Han December 12, 2022 06:22 AM UTC

Hi Yi Han,


As we already mentioned in our previous update, we have fixed the issue and this issue fix will be available in our upcoming 2022 Vol 4 main release, which is scheduled to be released on December 16, 2022.


Please let us know if you have any concerns.


Regards,

Sastha Prathap S.



RG Rajeshkannah G Syncfusion Team December 22, 2022 11:23 AM UTC

Hi Yi,


We are glad to announce that our Essential Studio 2022 Volume 4 Main Release V20.4.38 is rolled out and the fix for the issue “Pivotchart breaks while drill up/down for enum fields” has been included in this release. Please refer the following sample.


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/pivotchartdilldownup33013286


Output screenshot


Release Notes: https://blazor.syncfusion.com/documentation/release-notes/20.4.38?type=all#pivot-table


Please let us know if you have any concerns.


Regards,

Rajeshkannah Gopalakrishnan


Loader.
Live Chat Icon For mobile
Up arrow icon