Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to set the sort direction to no sort

Hi Team

I am trying to set the sort direction to no sort for the sorts using the below code and getting the exception followed.

Error: "Invalid sort direction"

for (int i = 0; i < count; i++)


               m_ReportDoc.DataDefController.SortController.ModifySortDirection(m_ReportDoc.DataDefinition.Sorts[i],                     CrSortDirectionEnum.crSortDirectionNoSortOrder);


I am doing this to handle removing sorting on Groups. I am getting error if try to delete the default sort provided on the groups. Getting the invalid field error and SAP agreed that there a bug. So as an alternative when user tries to delete sort provided on group I am setting it to NoSort and not showing it to the user if the sort direction is no sort.

Please let me know how can we set the sort direction to No sort or how can we remove the sorts on the groups.



Former Member
Not what you were looking for? View more on this topic or Ask a question