Procedure: Add Support for Interactive Sorting in a Relational
Report
Conditional sorting
could, of course, be added to our report via the method we undertook in Black Belt Components: Ad Hoc Sorting with Parameters, However, as we have already
noted, our specific focus in
this section will be the addition of support for interactive sorting through
leveraging new properties settings.
Let's open our new report in Layout view and make the
necessary settings to support the interactive sorting capabilities
requested by the information consumers.
1.
Right-click RS024_Interactive
Sort.rdl in the Solution Explorer.
2.
Select Open
from the context menu that appears, as shown in Illustration 17.
Illustration 17: Opening
the New Report ...
RS024_Interactive
Sort.rdl opens in
Layout view, and appears as depicted in Illustration 18.
Let's
preview the report, so as to get a feel for its general operation prior to
performing our enhancements.
3.
Click the Preview
tab to execute RS024_Interactive Sort.
Execution
begins (the report initially executes with the default parameter setting).
The
report executes, and appears as shown in Illustration 19.
Illustration 19:
The Report Appears Default Parameter Selection ...
We are
now positioned to enable the report to support interactive sorting. To
do so, we will return to Layout view, and then access the properties
settings for the Item Number textbox.
4.
Click the Layout
tab.
5.
Right click
the textbox containing the label Item Number (the heading for the Item
Number column in the report).
6.
Select Properties
from the context menu that appears, as depicted in Illustration 20.
Illustration
20: Accessing the Properties for the Item Number Column Heading ...
The Textbox
Properties dialog opens.
7.
Select the Interactive
Sort tab of the dialog.
8.
Click the
check box atop the tab labeled Add an interactive sort action to this
textbox.
The
checkmark appears in the check box, indicating that interactive sort is
enabled.
9.
In the Sort
expression box that appears immediately underneath the check box, select
the following from the options that appear within the selector:
=Fields!LineTotal.Value
10.
In the section
just below the Sort expression box, labeled Data region or grouping
to sort, click the radio button labeled Choose data region or grouping.
11.
In the
selector just below the radio button, select the following item:
SalesOrderDetail
12.
Leave the
radio button to the left of Detail scope, in the section labeled Evaluate
sort expression in this scope, at the default, selected setting.
We
leave the Detail scope selection in place as we intend only to sort the
repeating rows of the data region we have selected. Had the need arisen, we might
have specified another data region or group upon which to enact our sorts.
The Interactive
Sort tab of the Textbox Properties dialog appears as shown in Illustration
21.
Illustration 21: The Interactive Sort tab...
13.
Click OK
to save our settings and to dismiss the Textbox Properties dialog.
We return
to the Layout tab, where we are now ready to verify the effectiveness of
our modifications.