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