Drilldown Report Action Overview
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
In Design view, right-click a report item to which you want to add a toggle visibility action and then click Properties.
In the item's Properties dialog box, click Action.
Select Toggle Visibility. Additional sections appear in the dialog box for this option.
Click Edit toggle targets button, which opens Edit toggle Visibility targets dialog.
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.
To add more toggle targets, repeat steps 4 and 5.
The Toggle mark initially expanded checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.
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
In Design view, click the Table, CrossTab or ListBox to select it. The Group Explorer.
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.
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.
Alter the Visible property to indicate whether the group is displayed initially expanded or collapsed (default is expanded). Click OK.
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.
In the item's Properties dialog box, click Action.
Select Toggle Visibility. Additional sections appear in the dialog box for this option.
Click Edit toggle targets button, which opens Edit toggle Visibility targets dialog.
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.
To add more toggle targets, repeat steps 8 and 9.
The Toggle mark initially expanded checkbox determines if the item exposing the action will be rendered initially with expanded or with collapsed mark.
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})