Symptom
- Dynamically Sort Records in a Report based on User's selection in Parameter object
- Sort Records in a Crystal Report in Ascending or Descending order based on User's Selection
Environment
- Crystal Reports XI Release2
- Crystal Reports 2008
Resolution
- Use 'Command Object' to fetch the data
- Launch Crystal Reports and connect to "Xtreme" sample Database
- Add a Command Object
- Create a parameter in Command Object query with name "sort order"
- Add the following Command in the Command Object
SELECT `Customer`.`Region`, `Customer`.`Country`
FROM `Customer` `Customer`
ORDER BY `Customer`.`Country``{?sort order}`
6.When the Report is refreshed, the user can pass "Asc" or "Desc" into the Parameter to Sort the Records Dynamically
Keywords
Dynamic Sort , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Product
SAP Crystal Reports all versions
SAP Knowledge Base Article - Public