SAP Knowledge Base Article - Public

2926289 - Data displays in different order when viewing a report in Crystal Reports

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

  1. In Crystal Reports, create a report based on any data source.
  2. Insert a couple of fields on the report.
  3. Refresh the report, and take note of the order of the data.
  4. Save the report.
  5. Open the report on another computer, and refresh the report. 
  6. 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:
      
    1. In Crystal Reports, open the report.

    2. Under the menu "Report", select "Record Sort Expert..."
        
    3. In "Record Sort Expert", add a sort on a field that contains a unique value.
        
    4. Set the desired sort direction: Ascending, or Descending.
        
    5.  Click "OK"
        
    6. 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