Microsoft SQL Server 2005 Reporting Services
Interactive Sorting NEW in 2005
SSRS 2005 adds a new, interactive sort action that allows users to sort an HTML-rendered report. The RDL that describes interactive sorting is as follows :
<UserSort> <SortExpression>=Fields!Name.Value</SortExpression> </UserSort>
A developer can set up this type of sorting though a text box's property UserSort or through the Interactive Sort tab of a text box's property sheet (see Figure 12.2). Figure 12.2. Interactive sorting.
To determine the proper position of an interactive sorting control, visualize the output and decide what location makes sense for the interaction to occur. For example, to sort values within a group , a cell in a group header should contain an interactive sort control. The following are the components of an interactive sort:
There is nothing magical about interactive sorting behind the scenes. If you look at the rendered report's source, you will notice the following pieces of the puzzle were added to your field to be sorted:
[View full width]
[View full width] <a onclick="return ClientReportctl00.ActionHandler('Sort'
ImageName is initially unsorted.gif and changes to sortAsc.gif or sortDesc.gif , depending on the direction of the sort. This is internal functionality to SSRS and you do not want to mess with it. It reveals that the "magic" is simply scripting. You can further explore this functionality by adding more interactive sort fields and observing changes in rendered HTML and the report's URL. |