Hi,
i have code that create and excel file that needs to include groups and be sorted.
When i'm using the below code to sort, the action cause the excel to group the wrong lines since they are re-ordered.
Am i missing something?
how can i group lines and also sort them?
Thanks in advance,
Asaf
sorting code:
#region Do Sort
DataSorter dataSorter = workBook.DataSorter;
CellArea ca = new CellArea();
dataSorter.Key1 = dataExportArgs.ColumnIDToSortBy;
if (dataExportArgs.SortAssending)
dataSorter.Order1 = SortOrder.Ascending;
else
dataSorter.Order1 = SortOrder.Descending;
ca.StartRow = DataExportConst.firstDataRow;
ca.StartColumn = DataExportConst.firstColumn;
ca.EndColumn = dataExportArgs.Columns.Count;
ca.EndRow = rowIndex;
dataSorter.Sort(MainSheet.Cells, ca);
#endregion