Symptom
- Sort order different.
- Data sorted differently after migrating reports to a new server on a different version.
- Records are sorted in different order when viewing reports in Crystal Reports on different computers.
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In Crystal Reports, create a report based on any data source.
- Insert a couple of fields on the report.
- Refresh the report, and take note of the order of the data.
- Save the report.
- Open the report on another computer, and refresh the report.
- Notice the rows order is different.
Cause
- Regardless of the version of Crystal Reports, the rows of data have always the potentiel to shows in different order when:
- There is no sort defined on the report; or
- Multiple rows of data on which the report is sorted have the exact same value, and therefore there is no logical order in which to sort the data.
Resolution
- Add a sort on the report on a field that returns unique values:
- In Crystal Reports, open the report.
- Under the menu "Report", select "Record Sort Expert..."
- In "Record Sort Expert", add a sort on a field that contains a unique value.
- Set the desired sort direction: Ascending, or Descending.
- Click "OK"
- Save the report.
- Notes:
- The are 3 levels of sorting in a report: Group Summary Sort, Group Sort, and Record Sort.
- The steps provided above is for the Record Sort, which is the last level of sorting, therefore if the report does not sort in the expected order, it is because the report is sorted by a Group, or a Group Summary, before it sorts the Records.
Keywords
CR, sort order, data order, sort order different , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020