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!

Sorting report by selecting two parameter fields

Status
Not open for further replies.

Hm786

Programmer
Apr 5, 2001
88
US
Hi,

I have a report where I need to use two sort parameters, Sort1 and sort2. Based on my selection my report gets ordered. I can able to order the report with the sort1 . But when I select the parameter from the sort2 it doesn’t take the second sort order. (For example my report should sort as like in the oracle sort order column1, column2).Is there a way in crystal I can use two different parameters and do the sorting. Please let me know if anyone has come across this type of problem.



Thanks,
Hamida
 
Hi,

You need to use a parameter within a formula to determine which sort option you are going to do, eg.

{@formula_sort_order}
if {?sort_order} = "type" then {string_field_1}
else if {?sort_order} = "description" then {string_field_2}

Then group on the function

You will need to make sure all field types are the same,
or convert them all to text.

Hth,
Geoff
 
Hi,

Thank you for your reply, but I already have the formula called sort1 with the above syntax and added that formula in the record sort order as a sort field. This is working fine. But I need another sort parameter, sort2 and formula2 so that user selects the two parameters the report should sort based on the two fields.


Thanks,
Hamida
 
Hi,

have you left the fields in the sort aswell as the formulas.

If the fields are before the formulas then the formulas will not be picked up.

Geoff
 
Hi,

I fixed the report by creating two groups from the two sort formulas. These formulas uses two different parameters. My report sorts based on how the users selects values from the parameter lists.



Thank you for your help,
Hamdia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top