SAP Knowledge Base Article - Public

1662777 - How to change Group Sort Order based on a Parameter value Crystal designer

Symptom

How to change Group Sort Order based on a Parameter value in Crystal designer

Environment

Crystal Reports 2008 (All Versions)

Reproducing the Issue

1. Create a Crystal Report
2. Insert  group based on a field.

Resolution

1. Create a static parameter with string type.
2. Insert values(like id, value etc,) in value box and click on ok
3. Create a formula using the following code
     if {?parameter_name} = 'id' then {Customer.Customer ID}
     else
     if {?parameter_name} = 'value' then {Customer.Last Year's Sales}
4. Place above formula in detail section and create a summary on this formula.
5. Go in Report -> Group sort expert.
6.  Select Top N and  add the formula.

Note : Remove other sorts, if any, other than above formula.

Keywords

Group sort, dynamic group sort, group sort based on parameter. , KBA , BI-RA-CR-DSL , Crystal Reports on Data Semantic Layer , How To

Product

SAP Crystal Reports all versions