This walkthrough expands upon the report created in the Master Detail report walkthrough. If you have not created the Master Detail report (CustomerOrders.rdlx) already, please do so before continuing.
This walkthrough illustrates how to create a drilldown report using the Hidden and ToggleItem properties.
The walkthrough is split up into the following activities:
- Opening the Master Detail Report
- Hiding table rows and setting a toggle item
- Viewing the report
To complete the walkthrough, you must have access to the included Reels sample database.
Opening the Master Detail Report
To open the report in Visual Studio
- Open the Master Detail Report project in Visual Studio.
- In the Visual Studio Solution Explorer, double-click CustomerOrders.rdlx.
Hiding table rows and setting a toggle item
To hide the static labels and the detail row of the table and set a toggle item
- Click inside the table to display the column and row handles along the top and left sides of the table.
- Select the second group header row containing the static labels (Title, Quantity, and Price) by clicking the row handle to the left of it.
- Hold the SHIFT key and select the detail row containing field expressions to add to the selection.
- In the property grid, expand the Visibility property.
- Change the Hidden property to True.
- Change the ToggleItem property to TextBox10, or the textbox containing the expression =First(Fields!LastName.Value).
- From the File menu, select Save.
Viewing the report
Any report designed with Data Dynamics Reports can be opened in the included Data Dynamics Reports Viewer application or you can view it at design time.
To view the report at design time
- Click the Preview tab of the report designer.
- Click the + icon next to a customer to display order details for that customer.
- Click the - icon to hide the details.
To view the report at run time
- Add the ReportPreview control to your Visual Studio toolbox and drop it onto your Windows form.
- Set the Dock property of ReportPreview1 to Fill so that it will automatically resize if the form is resized at run time.
- Double-click the viewer to go to the Load event and use code like the following.
'Visual Basic.NET Dim rpt As New System.IO.FileInfo(Application.StartupPath & "..\\..\\CustomerOrders.rdlx") Me.ReportPreview1.OpenReport(rpt)
//C# System.IO.FileInfo rpt = new System.IO.FileInfo(Application.StartupPath + @"..\..\..\CustomerOrders.rdlx"); this.reportPreview1.OpenReport(rpt);
- Run the project.
- Click the + icon next to a customer to display order details for that customer.
- Click the - icon to hide the details.
Reference
Drill-Down Reports