SAP Knowledge Base Article - Public

1662710 - How to sort alphanumeric values in Crystal Reports

Symptom

How to sort alphanumeric values in Crystal Reports

Environment

Crystal Reports 2008 (All Versions)

Reproducing the Issue

  1. Create a Crystal Report based on alphanumeric field
  2. Apply sort on that field.

Resolution

1. Create a formula using the following code
     IF IsNumeric({TableName.TextNum}) = False
     THEN "0" & {TableName.TextNum} ELSE
     IF Len({TableName.TextNum}) < 2 // 2 is maximum field length, we can change the value based on requirement.
     THEN "0" & {TableName.TextNum} ELSE
     {TableName.TextNum}

2. Place it on detail section.
Note : You may have to extend this formula based on maximum length of the string.

Keywords

Sort alphanumeric values, sort, string sort , KBA , BI-RA-CR-DSL , Crystal Reports on Data Semantic Layer , How To

Product

SAP Crystal Reports all versions