We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to apply sorting property

Thread ID:

Created:

Updated:

Platform:

Replies:

125717 Sep 6,2016 04:47 AM Sep 8,2016 10:03 AM UWP 3
loading
Tags: XlsIO
Sharad Kumar
Asked On September 6, 2016 04:47 AM

Hi,

How to apply sorting in Excel file using Syncfusion xlsio engine.
I have attached the included excel sorting file.

ExcelEngine oengine = new ExcelEngine();
IApplication oApp = oengine.Excel;
oApp.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook oWorkbook  =  oApp.Workbooks.Create(1);
IWorksheets osheets = oWorkbook.Worksheets;
IWorksheet  osheet = osheets .Worksheets[0];

IDataSort sorter = oWorkbook .CreateDataSorter();
1) First file related code

sorter.SortRange = osheets.Range["D1:D26"];
sortField = sorter.SortFields.Add(4, SortOn.Values, OrderBy.Descending);
sorter.Algorithm = SortingAlgorithms.QuickSort;    
sorter.Sort();

2) Second file related code

sorter.SortRange = osheets.Range["E2:E10"];
 sortField = sorter.SortFields.Add(oRange2007.Column, SortOn.CellColor, OrderBy.OnBottom);
 sortField.Color = Windows.UI.Color.FromArgb(0, 255, 0, 0);
sorter.Sort();

This code is run successfully create sorting property . but In first file ascending/descending order is not set. and second file cell color color value is not set.

Thanks
sharad kumar

Attachment: New_folder_(7)_af2396e0.rar

Sridhar Sukumar [Syncfusion]
Replied On September 7, 2016 12:57 PM

Hi Sharad, 
 
Thank you for contacting Syncfusion support. 
 
We have analyzed you code and found that you are trying to sort single column data. When applying sorting for single column, we have found an issue “Sorting is not applied to single column data”. So please confirm us whether you have faced the same issue in your side. if no, kindly share us the detailed information of the issue you have faced in your side. 
 
Regards, 
Sridhar S 


Sharad Kumar
Replied On September 7, 2016 11:02 PM

Hi,

I am applied sorting for single column.
My code successfully create sorting property but Ascending/descending order is not set.

Similarly in Top10 AutoFilter property percent value is not.

Thanks

Sridhar Sukumar [Syncfusion]
Replied On September 8, 2016 10:03 AM

Hi Sharad, 

 

Thank you for updating us. 

  

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 

  

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

  

Please let me know if you have any questions. 

  

Regards, 

Sridhar S. 

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;