SAP Knowledge Base Article - Public

1218415 - Second on change of field in chart does not appear in the correct order when viewing the report in Crystal Reports

Symptom

  • Chart does not sort in the correct order.
  • In Crystal Reports, a chart is created based on two changes of fields. However, the second change of field does not appear in the correct order.
  • For example, if the first change of field is "order date" and the second change of field is "country" On the chart Aruba and Argentina appear after Australia even though the sort is set to ascending.

Environment

  • SAP Crystal Reports 2020
  • SAP Crystal Reports 2025

Reproducing the Issue

  1. In Crystal Reports, open an existing report, or create a new report.
  2. Add a chart with 2 database fields for the on change of, and one summary.
  3. When viewing the chart, the second database field is not sorted in the expected order.

Cause

  • This is normal behavior when there is no data for the value that are supposed to appear first in the sort order.
  • For example: This behavior occurs because Australia was the only country with sales in the first year (2020). Where in the second year (2021), countries that were not in the first year like Aruba and Argentina are appended to the current sort order.

Resolution

  • To work around this behavior, use a cross-tab too create the chart:
      
    1. Create a cross-tab. Set the first on change of field from the chart as the cross-tab column. Set the second on change of field from the chart as the cross-tab row.
    2. Right-click the cross-tab and click 'Insert Chart'. The 'Chart Expert' appears.
    3. Click the 'Data' tab and set the 'Subdivide by' field to the second on change of field.
    4. Make any other changes to the chart and then click 'OK'.
    5. Suppress the cross-tab.
    6. Save the report.
         
      A chart now appears with the second on change of field in the correct order.

Keywords

CR, Graphs, chart, On Change of, sort , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2020 ; SAP Crystal Reports 2025