ColumnFormat.SetAggregationFormat is not working

Posted by: msmith on 18 February 2019, 11:46 am EST

    • Post Options:
    • Link

    Posted 18 February 2019, 11:46 am EST - Updated 30 September 2022, 4:42 am EST

    Hi,

    I recently updated to the Spread.Net 12 and it appears that ColumnFormat.SetAggregationFormat is not working correctly - the format doesn’t appear get picked up correctly:

    I’ve attached a project using the code provided in your help here: http://help.grapecity.com/spread/SpreadNet12/WF/webframe.html#FarPoint.Win.Spread~FarPoint.Win.Spread.ColumnFooter~SetAggregationFormat.html

    SpreadAggregationFormat.zip

  • Posted 19 February 2019, 9:32 pm EST

    Hi,

    We can observe this issue and we’ve escalated it to the development team [Internal Tracking ID: 270155]. We’ll update this thread as soon as we get any information from the team.

    Regards,

    Jitender

  • Posted 20 February 2019, 11:11 am EST

    Jitender,

    Great - thanks for notifying me.

  • Posted 20 February 2019, 3:53 pm EST

    Hi,

    In Spread 12, the default ColumnFooterDataModel does not implement IAggregationSupport so setting AggregationFormat has no effect.

    You can create a new AggregationDataModel and use it as ColumnFooterDataModel:

    private void SetupSheet()
    {
        ................
        FarPoint.Win.Spread.Model.AggregationDataModel model = new
                    FarPoint.Win.Spread.Model.AggregationDataModel(fpSpread1.Sheets[0].Models.ColumnFooterData);
                fpSpread1.Sheets[0].Models.ColumnFooterData = model;
    
        // Set your ColumnFooter properties and format here
       .................
    }
    

    These changes are included in the attached sample. Please refer to it.

    Thanks,

    Jitender

    SpreadAggregationFormat.zip

  • Posted 24 February 2019, 9:24 pm EST

    Hi,

    I’ve added the change as suggested but I’m having some issues still with my specific usage of the Spread control.

    To briefly explain how I use the control - I utilise the product as a data grid binding to a DataTable. Users enter their data and we automatically add rows for new entries. In most cases our usage requires just one worksheet and in this situation the change provided works as expected.

    In some situations I also use multiple sheets where the first worksheet is like a summary view and subsequent worksheets show filtered results based on the chosen row in the summary view (master/detail style) - essentially the user changes tabs to enter detail for the summary item. To accomplish the filtering on the subsequent worksheets we use a DataView to find the related data.

    Now in the situation of changing tabs the Spread control crashes - see attached example project which I’ve put together which approximates (without the full complexity of my program) the basic setup I use. Note: you will need to restore the Newtonsoft.Json package from NuGet to compile.

    SpreadAggregationFormatFiltered.zip

    In the example app I load up 3 sheets with some sample data. The Spread control won’t allow me to select the 2nd tab (SecondaryA) and when I choose the 3rd tab (SecondaryB) the spread control crashes with a NullReferenceException in FpSpread.WndProc. If you locate class SpreadGridWorksheet and rem out row 48 (this.Models.ColumnFooterData = columnFooterDataModel) you will clearly see the app works as expected and I can change tabs successfully.

    This worked as expected in Spread v11. Thanks in advance.

  • Posted 25 February 2019, 8:35 pm EST

    Hi,

    We’ve asked the developers to look into this issue [Internal Tracking ID: 270303]

    We’ll let you know as soon as we get any update from them.

    Thanks,

    Jitender

  • Posted 26 February 2019, 11:10 am EST

    Jitender,

    Great thanks!

  • Posted 29 May 2019, 9:45 pm EST

    Hi,

    This issue has been fixed in Spread SP1. You can download it from here: https://www.grapecity.com/download/spreadnet

    Thanks,

    Jitender

  • Posted 29 October 2019, 9:45 am EST

    Thanks - sorry been away from this development for a period of time. Will check that out shortly.

  • Posted 29 October 2019, 4:23 pm EST

    Seems to be working thanks - will keep testing.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels