cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting sequence

Former Member
0 Kudos

Hi,

How can I define sorting sequence based on parameter selection in a prompt panel such that records gets sorted in that order ?

Also can I sort the data in individual parameter prompt for selection?

Thanks,

Karan Sheth

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Karan,

Let's assume you're trying to dynamically set the sort direction for a string field (Name) using a prompt. Here's what you need to do:

1) Create a formula called Sort1 with this code:

If {?Sort_prompt} = 'Ascending' then '!'

else {Database_Name_Field}

2) Create a formula called Sort2 with this code:

If {?Sort_prompt} = 'Descending' then '!'

else {Database_Name_Field}

3) Go to Record Sort Expert > Add the first formula field > Choose 'Descending' as the 'Sort Direction'.

Next, add the second formula to the list and this time choose 'Ascending' as the 'Sort Direction'.

Another way to do this if you're using CR 2008 or higher is to use the Sort Control feature. To use this feature, first add the database field you wish to sort on in the Record Sort Expert > Right-click the column header on the report > Select 'Bind Sort Control' > Choose the database field from the list.

This places two arrows on the column header for changing the sort direction at runtime.

For the second question please post a new discussion with a brief description of what you're trying to achieve.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Thanks for the help...

Thanks,

Karan Shethj

Former Member
0 Kudos

Hi Abhilash,

I tried the above formula and its working, but in my Record Sort Expert i am having 5 group fields and now i added 2 more @asc and @dsc .

My sort field is Date column.

i need to move this to 2 order

Example i need like this:

In Record Sort Order:

Group 1: Name

@asc

@dsc

Group 2: Add1

Group 3: Add2

Group 4: Add3

Group 5: Order No


now its in

Group 1: Name

Group 2: Add1

Group 3: Add2

Group 4: Add3

Group 5: Order No

@asc

@dsc

can you help me how to move this column?

abhilash_kumar
Active Contributor
0 Kudos

Dinesh please post this a new 'Discussion'.

-Abhilash

Answers (0)