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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sort records based on user input

Status
Not open for further replies.

abc567

Programmer
Jul 8, 2009
45
US
Hi,
I've a report which contains name, id and salary data.
I want to sort the records based on the user input.
I created a parameter with no database values appended, i've written ASC and DESC values in parameter.

I want to display records based on the user input like if user selects ASC then name should be in ascending order or if DESC then in descending order.

How to achieve this goal ?
 
Create two formulas:

//{@asc}:
if {?sortorder} = "ASC" then {table.name}

//{@desc}:
if {?sortorder} = "DESC" then {table.name}

Add each of these to report->sort records and choose the sort order that matches the name of each formula. Only the one that matches the user selected parameter option will affect the sort order of the data.

-LB
 
Thanks for your reply lbass.
I created 2 formulas as you said.
Added these formulas to the report.

What am i suppose to do after that?
When i am refreshing it, am getting parameter prompt and when i selected ASC or DESC nothing seems to work, the records are appearing as used to be.

I want to sort the records based on ASC and DESC.
If ASC is selected then in Ascending order
If DESC is selected then in Descending order

Thanks for your help
 
Add each of these to report->sort records and choose the sort order that matches the name of each formula."

-LB
 

There is only one option available to sort the records i.e., by using Record sort expert.

I dont see the option Report -> Sort Records

 
I got it !

I gotta select the formula fields in Record Sort Expert .
For ASC - choose Ascending
For DESC - choose Descending


Thank you very much lbass.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top