Symptom
How to sort alphanumeric values in Crystal Reports
Environment
Crystal Reports 2008 (All Versions)
Reproducing the Issue
- Create a Crystal Report based on alphanumeric field
- 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
SAP Knowledge Base Article - Public