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!

Parameters Issue

Status
Not open for further replies.

Cherrel

Technical User
Dec 5, 2001
34
US
Greetings All!

I have an issue regarding PARAMETERS and the extent of it's ability. I'm writing a report (actually, updating an existing report) and I need enter a parameter that prompts a user of the report to select the method by which they want to "SORT" the report by.

The best case would be to allow the user to choose which field (sort by either: (1) EQUIPMENT, (2) ITEM, (3) MODEL NUMBER, etc., etc) the sort is goverened by . (These fields are always present in the report.)

Thanks to all!
Cherrel.

 
Are you sorting on one field at a time or do you want to have a multi-level sort?
 
As far ask I know, just a single level sort.

FYI: the fields from within this report come from multiple tables.
 
1) Create a parameter field with a list of fields the user is able to sort by (Equipt, Item, etc...)

2) Create a formula that references the parameter:

If {?Sort_Param} = Equipment Then {table.equipfield} Else
If {?Sort_Param} = Item Then {table.itemfield} Else etc...

3) Add your new formula field to your report (you can suppress it if you like)

4) Go to the Report|Sort Records Menu Item and create a sort based on your new formula field.

One note of caution, this only works if all your datatypes are the same (all string, all number, etc...). If you have mixed data types, you will need to create multiple formulas per the following instructions:

 
If all your sort fields are of the same datatype, all is OK. If they are different, you will have to change them to the same datatype:

if {?SortOrder} = "N" then
ToText ({table.date},"yyyy-MM-dd")
else
if {?SortOrder} = "D" then
ToText ({table.partno},"######",0,"") etc....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top