How to Create a Master-Detail Report in Bold Reports Report Designer
To create a master-detail report in the Bold Reports Web Report Designer, write one query that returns both master and detail records, bind it to a table (tablix), group the master fields, then insert a nested detail row inside that group to show the related detail records together.
Applies to: Bold Reports Web Report Designer (Enterprise and Cloud Reporting) · RDL (Report Definition Language) reports
When to use this
Use this when your data source holds a master-detail relationship (for example, product categories and the products under each) and you want a single report that shows each master record with its related detail records nested beneath it.
Steps
- Open the Bold Reports Web Report Designer.
- Create a data source that connects to your database. See Data connectors.
- Create an embedded dataset that returns both the master and detail records in one result set. See Create an embedded dataset. This example uses the
ProductCatalogdataset built from the query below.
SELECT TOP 60
PS.Name AS ProdSubCat, PM.Name AS ProdModel, PC.Name AS ProdCat,
PD.Description, PP.LargePhoto, P.Name AS ProdName, P.ProductNumber,
P.Color, P.Size, P.Weight, P.StandardCost, P.Style, P.Class, P.ListPrice
FROM Production.Product P
INNER JOIN Production.ProductSubcategory PS
INNER JOIN Production.ProductCategory PC
ON PS.ProductCategoryID = PC.ProductCategoryID
ON P.ProductSubcategoryID = PS.ProductSubcategoryID
INNER JOIN Production.ProductProductPhoto PPP
ON P.ProductID = PPP.ProductID
INNER JOIN Production.ProductPhoto PP
ON PPP.ProductPhotoID = PP.ProductPhotoID
LEFT OUTER JOIN Production.ProductDescription PD
INNER JOIN Production.ProductModel PM
INNER JOIN Production.ProductModelProductDescriptionCulture PMPDCL
ON PM.ProductModelID = PMPDCL.ProductModelID
ON PD.ProductDescriptionID = PMPDCL.ProductDescriptionID
ON P.ProductModelID = PM.ProductModelID
WHERE (PMPDCL.CultureID = 'en')
ORDER BY PC.Name, PS.Name, PM.Name, P.Name;
-
Drag a Table report item onto the design surface and bind the master fields (for example,
ProdCat,ProdSubCat, andProdModel) to its cells. This table is the master section. -
Add a row group on the master field so each master value prints once. See Add grouping and totals to a tablix and Insert or delete a row group.
-
Drag a second Table report item onto the design surface and bind the detail fields (for example,
ProdName,ProductNumber,ListPrice). This table is the detail section.
- Right-click the last row of the master table, select Insert Row, and then click Inside Group - Below. This adds a row that belongs to the master group.
- Select every cell in the new row with Ctrl + left-click, right-click a selected cell, and click Merge Cells.
- Cut the detail table from the report body and paste it into the merged cell inside the master group.
-
Click Preview at the top-right of the Report Designer toolbar to render the report.
Result
Each master record (for example, a product category or model) prints once, with its related detail records shown in the nested table directly beneath it. The master and detail data appear together in a single tablix, with no subreport required.
Troubleshooting
The “Inside Group - Below” option is missing from the Insert Row menu
The table has no row group, so there is no group to insert the row into. Add a row group on the master field first, then right-click the last row again. See Insert or delete a row group.
The detail records repeat for every master row instead of grouping
The detail table is still in the report body, or it was pasted outside the master group row. Confirm the detail table sits inside the merged cell of the Inside Group - Below row, so it renders once per master record.
Frequently asked questions
What is a master-detail report?
A master-detail report shows records from a parent entity (the master) together with the related child records (the detail) for each one, such as each order with its line items.
Do I need a subreport to build a master-detail layout?
No. This approach nests a detail table inside a master group in the same tablix, so a single dataset and one report render both levels. A subreport is one alternative, not a requirement.
Can I use a matrix or list instead of a table?
Yes. Row grouping works across table, matrix, and list data regions, since they share the same tablix engine. The nested-row technique in this article applies to the table data region.
Can I export the master-detail report?
Yes. Once the report previews correctly, you can export it from the Report Viewer toolbar to formats such as PDF, Excel, and Word.