BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Pivot Chart Dilldown/Up (https://blazor.syncfusion.com/documentation/pivot-table/pivot-chart#drill-downup ) does not seem to support Enum type.
Repro path:
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
A side question please:
in terms of aggregation performance, what is difference between Enum type (so underlying int) versus String ?
Thx!
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.
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
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:
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
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
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
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.
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.
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
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.
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