16. Master detail and sub reports
Master-detail structures connect a main data record with any number of detailed data records - such as document headers with items or items with storage locations.
Master detail and sub reports
Master-detail structures connect a main data record with any number of detailed data records - such as document headers with items or items with storage locations.
Open Report designer on the desktop Administration.
Your goal
You can build an existing master-detail relationship as a DetailReport and understand when a separately saved subreport makes sense.
Why this is crucial in the report designer
The typical ERP document structure is created here: one customer, one order, many positions. When main and detail context are cleanly connected, data remains complete and totals remain correct.
Elements and settings at a glance
- Master: Main data record, for example document header or partner.
- Details: Subordinate records, for example positions or contact persons.
- Relations: Defined relationship between key of main and foreign key of detail area.
- Detail report volume: Subreport area with its own data member and bands.
- Subreport: Control that embeds a separately saved report template.
- Report Source URL: Name of the subreport template in the report store.
- Binding parameters: Passes a value from the main report to a parameter from the subreport.
Here's how to do it
- Check the field list to see whether a suitable relationship exists.
- Insert a DetailReport band and select the relationship as a data member.
- In the details area, build the table header, detail row and total.
- Use a subreport only for layouts that are reused independently or saved separately.
- For the subreport, bind the key of the main data record to the appropriate subreport parameter.
Exercise
Create a main area with document number and partner, including a detail table with items. Then test a data set without, with one and with many positions.
Check the result
- Detail rows belong exclusively to the current main data record.
- Each position appears exactly once.
- Parameter binding and data type match.
- Empty detail areas do not leave misleading space.
Typical errors and their solutions
- Missing relation: Can result in a combination of all master and detail records.
- Subreport without filter parameters: Possibly shows foreign or all detailed data.
- Nesting without need: Complicates preview, maintenance and performance.
Your result
They map complex X-ERP data hierarchically without losing assignment, readability or calculation logic.
Related topics
- For customizers – customize screens and forms › Report designer › 04. Data source, data member and field list
- For customizers – customize screens and forms › Report designer › 05. Ribbons and print sequence
- For customizers – customize screens and forms › Report designer › 13. Parameters and filters
Frequently asked questions
What can I implement myself according to this page?
You can build an existing master-detail relationship as a DetailReport and understand when a separately stored subreport makes sense.
How do I recognize a shareable result?
Detail rows belong exclusively to the current main data set. Each position appears exactly once. Parameter binding and data type match. Empty detail areas do not leave misleading space.