Creating a Master-Detail Report with Nested Data Regions in Bold Reports
A Master-Detail report is an effective way to present related datasets in a hierarchical structure. To integrate the master details report with Bold Reports, it is necessary to flatten the data through a JOIN query and grouping. Elements need to be utilized for displaying master-details data. This guide will walk you through the process of creating a Master-Detail report using nested data regions, especially useful for representing one-to-many relationships.
-
Create the embedded datasource and dataset for the report. Below is a sample query using the
AdventureWorks
database:SELECT HumanResources.EmployeeDepartmentHistory.EmployeeID, HumanResources.EmployeeDepartmentHistory.DepartmentID AS [EmployeeDepartmentHistory DepartmentID], HumanResources.EmployeeDepartmentHistory.ShiftID, HumanResources.EmployeeDepartmentHistory.StartDate, HumanResources.EmployeeDepartmentHistory.EndDate, HumanResources.EmployeeDepartmentHistory.ModifiedDate AS [EmployeeDepartmentHistory ModifiedDate], HumanResources.Department.DepartmentID AS [Department DepartmentID], HumanResources.Department.Name, HumanResources.Department.GroupName, HumanResources.Department.ModifiedDate AS [Department ModifiedDate] FROM HumanResources.Department INNER JOIN HumanResources.EmployeeDepartmentHistory ON HumanResources.Department.DepartmentID = HumanResources.EmployeeDepartmentHistory.DepartmentID
-
Drag and drop the List report item onto the design area in your report designer.
-
Select the List report item and choose the Group Properties from the Grouping Panel. Here, add a group expression:
-
Choose the
DepartmentID
field as the parent group to organize the data based on the Department ID as shown in the following snapshot. -
Inside the List report item, add a Tablix data region with default header and detail rows. This will serve as the child group where you can drag and drop the required dataset field values into the Tablix cells.
-
Preview the report to ensure that the data is correctly grouped and displayed. You should see the data rendered in a stepped format, showing the relationship between departments and their respective employee histories.
By following these steps, you can create a Master-Detail report that clearly displays hierarchical data. This type of report is ideal for showing relationships such as departments and employees within an organization. For further reference, kindly refer to the attached sample report.