SAP Knowledge Base Article - Public

1207808 - The hyphenated text string field sorts incorrectly

Symptom

  •  The sort field contains text string with hyphen ("-") character cannot sort correctly

Reproducing the Issue

  1. Create a new report with the field contains the following data .

    e.g. ABC-123

ABC-223

ABC-EFG

ABCE-123

ABCF-234

ABC-GHI

  1. Click Report > Record Sort Expert.
  2. Select the field which is sorted and click >.
  3. Select Ascending in the Sort Direction and click OK.
  • Crystal Reports XI Release 2
  • Crystal Reports 2008
  • Access Database
  • Excel File
  • ADO.NET (XML)

Resolution

Workaround : Create the formula field to be sorted, instead the sort field contains hyphen ("-") character.

  1. Create the following formula field.

    WhileReadingRecords;

    Replace({hyphened text string field}, "-", "*");

  1. Click Report > Record Sort Expoert.
  2. Select the above formula field and click >.
  3. Select Ascending in the Sort Direction and click OK.
  4. Click Refresh.

The following data is displayed as desired sorting.

    e.g. ABC-123

ABC-223

ABC-EFG

ABC-GHI

ABCE-123

ABCF-234

Keywords

cr, rpt, sorting, ascending, descending, wrong order, mdb, xls, xml, hyphen, c2000538 , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports XI R2