SAP Knowledge Base Article - Public

1876499 - How to obtain the same sort sequence as appears in the chart in Crystal Reports?

Symptom

  • Chart and cross-tab sort are different.
  • How to sort a cross-tab, in the same order as it appears on a chart?
  • A report that contains a chart a Cross-tab shows different sort order when refrshing a report in Crystal Reports. How to set chart and cross-tab to sort the same way?

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
       
  2. Insert a bar chart on the report.
       
  3. Set the bar chart order based on the Top N values in desending order.
    • Right click on the chart and select Chart Expert  
    • Under the Data tab, click on the database field under: On change of.
    • Click on TopN button, and select Bottom N for displaying data in ascending order in the chart OR Top N for displaying data in descending order in the chart from drop down list.
    • Set the appropriate value e. g. 15 for the field Where N is:
    • Click on OK.
         
  4. Insert a Cross-tab on the report using the same database fields on the cross-tab for rows and summary.
        
  5. When refreshing the report, the cross-tab and the chart are sorted in different order.

Cause

  • Sort set on a chart, only applied to the specific chart it was setup for, and not to other objects inserted on the report, like a cross-tab, or other charts. This is why the cross-tab shows the information in different order.

Resolution

  • Set the sort on cross-tab, the same way as the sort in the chart. To do so:
    1. Right Click on the Cross-Tab and select "Cross tab Expert"
         
    2. Select the database field in the Rows section on which the sorting is performed in the chart.
           
    3. Right click on one of the row header.
        
    4. Select Row Options > Row Group Sort Expert.
        
    5. Select Bottom N for displaying data which is in ascending order in the chart OR Top N for displaying data which is in descending order in the chart from drop down list.
         
    6. Set the appropriate value, like: 15 for the field Where N is:.
        
    7. Refresh the report, and now the cross-tab and the chart are sorted the same way.
       
              
      Note: The option Row Options > Row Group Sort Expert is only available for Rows in the Cross-Tab, the same option is not available for columns.

Keywords

Crystal Reports, CR, Cross tab, Chart, Sort, Order, Sequence , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016

Attachments

Chart.png
Cross tab.png