New to Telerik Reporting? Download free 30-day trial

Drilldown Report Action

You can control whether a report item initially displays or is hidden when a user views a report. By providing a toggle on a text box, you can enable users to hide and display items interactively. For a Table or CrossTab, you can show or hide dynamic (associated with groups), static and detail row and column groups. The main reason for hiding items is usually for clarity - a report that initially shows summary but enables users to drilldown into detail data.

For example, you can initially hide(Visible=false) all the row groups except the outer parent group for a table. For each inner group (including the details group), add a drilldown action to the grouping cell of the containing group. When the report is rendered, the user can click the text box to expand and collapse the detail data.

To define a drilldown action add a ToggleVisibilityAction on an item. To define if the item exposing the action will be rendered initially with expanded or with collapsed mark, use the DisplayExpandedMark property.

The report item that you use for the toggle visibility action must be in a containing scope that controls the item that you want to show or hide. Example: to hide a row group, the report item must be in a row group associated with the parent group or higher in the containment hierarchy.

How to Add a Drilldown/Toggle Visibility Action

A report item can initially display or be hidden when a user views a report. The toggle action applied on the report item that allows you to hide and display items interactively is known as drilldown action.

Adding a drilldown action to a report item using the Report Designer

  1. In Design view, right-click a report item to which you want to add a toggle visibility action and then click Properties.

  2. In the item's Properties dialog box, click Action.

  3. Select Toggle Visibility. Additional sections appear in the dialog box for this option.

  4. Click Edit toggle targets button, which opens Edit toggle Visibility targets dialog.

  5. Click New button to add a new toggle action. Select a report item from the combobox to set it as toggle target, which visibility will be toggled when the action is triggered.

  6. To add more toggle targets, repeat steps 4 and 5.

  7. The Toggle mark initially expanded checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.

  8. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show report items with their toggled visibility.

The report item must be in the same container hierarchy or higher (up to the report itself).

Adding a drilldown action to a Table, CrossTab or ListBox group using the Report Designer

  1. In Design view, click the Table, CrossTab or ListBox to select it. The Group Explorer.

  2. Locate the Display Mode combo in the title bar of the Group Explorer and select Extended Mode. This toggles to show the underlying display structure for rows and columns.

  3. Right-click the name of the row group or column group for which you want to hide the associated rows or columns and select Group Properties.

  4. Alter the Visible property to indicate whether the group is displayed initially expanded or collapsed (default is expanded). Click OK.

  5. In Design view, right-click the report item representing the row group or column group to which you want to add a toggle visibility action and then click Properties.

  6. In the item's Properties dialog box, click Action.

  7. Select Toggle Visibility. Additional sections appear in the dialog box for this option.

  8. Click Edit toggle targets button, which opens Edit toggle Visibility targets dialog.

  9. Click New button to add a new toggle action. Select a row group or column group from the combobox to set it as toggle target, which visibility will be toggled when the action is triggered.

  10. To add more toggle targets, repeat steps 8 and 9.

  11. The Toggle mark initially expanded checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.

  12. To test the toggle, run the report and click the text box with the toggle mark. The report display refreshes to show report items with their toggled visibility.

The report item must either be in the same group as the item that is being hidden or in an ancestor group.

Adding a drilldown action programatically

Telerik.Reporting.ToggleVisibilityAction toggleVisibilityAction1 = new Telerik.Reporting.ToggleVisibilityAction();
textBox1.Action = toggleVisibilityAction1;
toggleVisibilityAction1.DisplayExpandedMark = false;
toggleVisibilityAction1.Targets.AddRange(new Telerik.Reporting.IToggleVisibilityTarget[] { textBox2 });
Dim toggleVisibilityAction1 As New Telerik.Reporting.ToggleVisibilityAction()
textBox1.Action = toggleVisibilityAction1
toggleVisibilityAction1.DisplayExpandedMark = False
toggleVisibilityAction1.Targets.AddRange(New Telerik.Reporting.IToggleVisibilityTarget() {textBox2})

See Also

In this article