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 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 bar chart on the report.
- Set the bar chart order based on the Top N values in desending order.
- 3.1 Right click on the chart and select Chart Expert
- 3.2 Under the Data tab, click on the database field under: On change of.
- 3.3 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.
- 3.4 Set the appropriate value e. g. 15 for the field Where N is:
- 3.5 Click on OK.
- Insert a Cross-tab on the report using the same database fields on the cross-tab for rows and summary.
- 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:
- Right Click on the Cross-Tab and select "Cross tab Expert"
- Select the database field in the Rows section on which the sorting is performed in the chart.
- Right click on one of the row header.
- Select Row Options > Row Group Sort Expert.
- 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.
- Set the appropriate value, like: 15 for the field Where N is:.
- 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
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020
Attachments
Chart.png |
Cross tab.png |