To sort a group conditionally – HP Intelligent Management Center Standard Software Platform User Manual
Page 222
For example, if you group a sales report by invoice date, you might want
your users to choose whether they see that data from earliest invoice date
to most recent invoice date (ascending order) or most recent invoice date to
earliest invoice date (descending order).
To create a conditional group sort order for this report, you might create a
new parameter to prompt for the user's selection, and then pass this selection
to a conditional group sorting formula.
To sort a group conditionally
1.
Open or create the report that you want to sort conditionally.
In the case of the example mentioned in this section, open or create a
report that contains invoice information.
2.
In the Field Explorer, select Parameter Fields, and click New.
3.
Create a string parameter that contains the sorting options that you want
your users to see.
For this example, create a parameter called Sort Order that has two
values: Ascending and Descending.
Tip:
For information about how to create parameters, see
4.
Click OK to save your parameter.
5.
On the Insert menu, click Group.
6.
In the Insert Group dialog box, select the field that you want to group on.
For this example, select your invoice date field.
7.
Select Use a Formula as Group Sort Order, and click the
Conditional Formula button next to it.
Note:
This option is not available if you choose "in specified order" as the sort
order for your group.
8.
In the Formula Workshop, enter your conditional formula text.
222
Crystal Reports 2008 SP3 User's Guide
Sorting, Grouping, and Totaling
10
Grouping data