RefreshData doesn't sort data before opening file

 Workbook wb = new Workbook(@"../../APP_DATA/UnsortedSamleData1.xlsb");
        Worksheet ws = wb.Worksheets[1];

        var pTable = ws.PivotTables[0];

        pTable.RefreshDataFlag = true;

        pTable.RowFields[2].IsAutoSort = true;
        pTable.RowFields[2].IsAscendSort = false;
        pTable.RowFields[2].AutoSortField = 43;

       //pTable.RefreshDataOnOpeningFile = true;
        //Need ptable to be sorted by here. We will be using the sorted index for grouprows for accounts with empty amounts in the next code.  
        //Currently ptable is not sorted and is messing up with groupsrows

        wb.Save(@"../../APP_DATA/Output.Xlsb", SaveFormat.Xlsb);

        //it sorts fine once the excel is opened means RefreshDataOnOpeningFile is working fine.



Thanks for your query.
Please provide your sample file along with the detailed description of issue with the help of images/snapshots. We will reproduce the problem and provide our feedback after analysis.


Thanks for the response. I am uploading the sample file and my (489.5 KB)



We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46484 - RefreshData doesn’t sort data before opening file in Excel