In a page layout, you can set up data regions, report controls, table rows, and matrix row and column groups to collapse, so that users can drill down into the data they choose to view.
In order to collapse an item, you use the Visibility settings available in the Properties Window or in the control dialog. You set the initial visibility of the report controls to Hidden and allow the user to toggle them by clicking other report controls (usually a TextBox).
When the report is initially displayed at run-time, the toggle items display with plus sign icons that you can click to display the detail data. Use the following steps to set a drill-down link.
- From the Visual Studio toolbox, drag and drop a TextBox control and a Table data region onto the report design surface. え
- Place the TextBox control such that it appears as a header on your report.
- From the Report Explorer, expand your data set and drag fields and place them inside the detail row of the Table data region. Expressions for these fields appear in the detail row, and labels appear in the table header row.
- With the Table data region selected on the design surface, under the Properties window, click the Property dialog link. This is a command to open the respective control's dialog. See Properties Window for more on how to access commands.
- In the Table dialog that appears, go to the Visibility page, change the Initial visibility to Hidden, and select the check box next to Visibility can be toggled by another report item.
- From the drop-down list that appears, select the TextBox that you added in step 1. The TextBox is now used to toggle items in the Table and show detail data.
- Click OK to save the changes.
When you view the report, the Textbox displays an Expand/Collapse icon to its left.
Click the icon to view the hidden data.