Serialization GregorianCalender in the pivot cause to exception

1 Answer 13 Views
PivotGrid
n/a
Top achievements
Rank 1
n/a asked on 02 Mar 2022, 09:13 AM
 


Hi,

Our request relates to the solution “LocalDataSourceSerialization_WPF“  on PivotGrid/Serialization/LocalDataSourceProvider in your git examples.

When we run the following scenario, we get an exception (see the attached video) :

1. Run The solution.
2. Click on “Sum of quantity” to open the menu.
3. Click on “More Calculation Options...”.
4. Choose “% Of”.
5. Choose “Date-Month” as the Base field and one of the Base Items for example “June”.
6. Press Ok.
7. Click on “Save”.
8. The system crashed with the following error (attached image).

We would be happy if you would guide us on how we could overcome the problem.

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 07 Mar 2022, 08:30 AM

Hello Luz,

As discussed in the support ticket you opened, you can resolve the issue by adding the GregorianCalendar to the list of KnownTypes:

    public class LocalDataSourceSerializer : DataProviderSerializer
    {
        public override IEnumerable<Type> KnownTypes
        {
            get
            {
                return PivotSerializationHelper.KnownTypes.Concat(new List<Type>() { typeof(GregorianCalendar) });
            }
        }
    }

This will, however, only work for projects targeting the .NET framework. In .NET Core, there is an issue that prevents the serialization of these fields: DCS/DCJS: CultureInfo is not serializable. With this said - you would need to skip these fields when performing the serialization to avoid the exception.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PivotGrid
Asked by
n/a
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or