Error loading layout!

5 posts, 1 answers
  1. Daniel
    Daniel avatar
    4 posts
    Member since:
    Aug 2016

    Posted 04 May Link to this post

    Hi,

    I'm having this error when loading a layout with a CustomAggregate.

    I'm attaching the Layout XML

  2. Daniel
    Daniel avatar
    4 posts
    Member since:
    Aug 2016

    Posted 04 May Link to this post

    My custom aggregate
  3. Daniel
    Daniel avatar
    4 posts
    Member since:
    Aug 2016

    Posted 04 May Link to this post

    public class CountDistinctAggregateFunction : Telerik.Pivot.Core.Aggregates.AggregateFunction
        {
            public override string DisplayName
            {
                get { return "CountDistinct"; }
            }

            protected override AggregateValue CreateAggregate(Type dataType)
            {
                return new CountDistinctAggregate();
            }

            public override string GetStringFormat(Type dataType, string format)
            {
                if (format == null)
                {
                    return "G";
                }

                return format;
            }

            public override string ToString()
            {
                return "CountDistinct";
            }

            public override bool Equals(object obj)
            {
                return obj is CountDistinctAggregateFunction;
            }
  4. Answer
    Hristo
    Admin
    Hristo avatar
    1018 posts

    Posted 05 May Link to this post

    Hello Daniel,

    Thank you for writing.

    Our Save/Load API is relying on .NET 2.0 and cannot serialize the custom aggregation functions because it cannot use the DataContract attribute. In case you would be using our .40(.NET 4.0) assemblies you could serialize and deserialize the custom functions by implementing a custom DataProviderSerializer similar to the approach with serialization of cubes: http://docs.telerik.com/devtools/winforms/pivotgrid/save-and-load-layout/serialize-adomddataprovider.

    I am sending you attached a sample project which should get you going. 

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Daniel
    Daniel avatar
    4 posts
    Member since:
    Aug 2016

    Posted 29 Jun in reply to Hristo Link to this post

    That worked great! Thanks
Back to Top