Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I define sort-order at runtime?

Status
Not open for further replies.

CInman

IS-IT--Management
Mar 15, 2001
81
GB
With a Crystal 7 report, can I somehow define the sort order of the DETAILS section at runtime? I suspect it may be something to do with Groups and "in specified order", but I cannot work it out??
 
1. Create a parameter called 'Sort_order' of type string. Set default values for all the sort orders eg; Surname, Firstname.

2. Create a formula called 'Sort_by'. This should be something like:
If {?Sort_order} = 'Surname'
then {tablename.surnamefield}
else If {?Sort_order} = 'Firstname'
then {tablename.firstnamefield}
else etc;

3. Specify the sort order of the report to be {@Sort_by}
 
Thank you for your update - so can I specify the sort order too like this?
 
Yes. Point 3 needs more explanation:

Go to the menu Report->Sort Records option.

The formula {@Sort_by} will be available from the field list in the left hand side of the window.

Selecting this field will cause the report to be sorted on whatever the user selects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top