RefreshData doesn't sort data before opening file


#1
 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;
        pTable.RefreshData();           
        pTable.CalculateData();
      
        //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.

#2

@LakshmiAys,

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.


#3

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


#4

@LakshmiAys,

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