Skip to main content

Provide Interactivity to the Report

  • 2 minutes to read

This tutorial demonstrates how to enable sorting report data in Print Preview and provide the drill-down functionality that allows collapsing and expanding specific document sections.

Enable Data Sorting in Print Preview

Do the following to enable sorting report data in Print Preview:

  1. Select the table cell displaying the Product caption in the detail report’s Group Header band.
  2. Switch to the Properties panel and expand the Behavior category. In the Interactive Sorting section, set the Target Band property to the detail report’s Detail band.


  3. The band’s Sort Fields collection contains the Product Name field against which the detail report was sorted in the previous tutorial. Add the required field to this collection, if it is empty.
  4. The arrow next to the Sort By property indicates the default sorting direction in Print Preview. Click this arrow until it displays the report-server-sort-order-no-sorting icon if you do not require default sorting.
  5. Set the table cell’s Field Name property to the ProductName field.


Click the Preview report-server-web-preview-button toolbar button to see the result. When a mouse pointer hovers over the Product caption, it changes to a hand, indicating the sorting capability. The arrow at the element’s right edge indicates the sorting order.


Create a Drill-Down Report

This section describes how to add a drill-down functionality to your report, hide the detail data in a document and access this data by clicking a link in the document.

  1. Drop the Label control from the Toolbox onto the master report’s Detail band to create a link for toggling the detail report’s visibility state.


  2. Double-click the added label and type Show/Hide Details.


  3. Switch to the Properties panel, expand the Appearance category and apply the required formatting (for example, the blue color and underlined text) for this label to resemble link.


  4. Select the Detail Report band, and in the Properties panel, expand the drop-down list for the Drill-Down Control property.

    The list displays all report controls available on the report band that is one level above the current band in the hierarchy. Select a previously added label from the drop-down list. Clicking this label expands and collapses the detail report in Print Preview.


    You can also use the Drill-Down Expanded property, which is enabled by default, to specify whether the band is initially expanded.

Switch to Print Preview to see the resulting document.