Report Examples Parent-child-section report
This is an example report using the parent-child-section template
Contents
<div class="govuk-width-container">
<div class="dpr-report-page govuk-width-container report-list-container">
<div class="dpr-report-print-message-container">
</div>
<div class="dpr-report-page__heading-container">
<div class="dpr-report-header">
<div class="dpr-report-heading__actions">
<div class="report-actions" data-dpr-module='report-actions'>
<div class="moj-button-menu"></div>
<div class="dpr-display-none">
</div>
</div>
</div>
<div class="dpr-report-heading">
<div class="dpr-report-heading__title">
<h1 id="dpr-report-name" class="govuk-heading-xl">
<span class="govuk-caption-l">Report templates</span>
Parent-child-section
</h1>
</div>
</div>
<div id="dpr-download-message" class="dpr-download-message--hidden govuk-!-margin-bottom-6" data-dpr-module='download-message'>
<article class="moj-ticket-panel" aria-label="Sub navigation 1">
<section class="moj-ticket-panel__content moj-ticket-panel__content--blue" aria-label="Section 1">
<h2 class="govuk-heading-m">To download this report</h2>
<p><a href="/embedded/platform/dpr/download-report/request-download/report-template-examples/report-template-parent-child-section/tableId/tblId_1769454262897/form?reportUrl=/embedded/platform/dpr/view-report/async/report/report-template-examples/report-template-parent-child-section/tblId_1769454262897/report" class="govuk-link govuk-link--no-visited-state">Fill out a form</a>, which will take about 1 minute to complete.</p>
<p>You can then download the report whenever you need it.</p>
</section>
</article>
</div>
<details class="govuk-details dpr-meta-data-details">
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
Report details
</span>
</summary>
<div class="govuk-details__text">
<div class="dpr-request-details">
<table class="dpr-request-details__table" id="dpr-request-details-table">
<tbody>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Name:</p>
</td>
<td>
<h2 class="govuk-heading-s govuk-!-margin-bottom-0">Parent-child-section</h1>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Product:</p>
</td>
<td>
<h2 class="govuk-heading-s govuk-!-margin-bottom-0">Report templates</h1>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Description:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">Template: "parent-child-section". </br> A report with parent and child datasets in sections</p>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Classification:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">OFFICIAL</p>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Requested at:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">26/01/2026, 19:04:24</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</details>
<div class="dpr-report-details-print">
<div class="dpr-request-details">
<table class="dpr-request-details__table" id="dpr-request-details-table">
<tbody>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Name:</p>
</td>
<td>
<h2 class="govuk-heading-s govuk-!-margin-bottom-0">Parent-child-section</h1>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Product:</p>
</td>
<td>
<h2 class="govuk-heading-s govuk-!-margin-bottom-0">Report templates</h1>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Description:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">Template: "parent-child-section". </br> A report with parent and child datasets in sections</p>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Classification:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">OFFICIAL</p>
</td>
</tr>
<tr>
<td class="dpr-request-details__table-heading">
<p class="govuk-body-m dpr-request-details__table-heading_name">Requested at:</p>
</td>
<td>
<p class="govuk-body-m govuk-!-margin-bottom-0">26/01/2026, 19:04:24</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="dpr-report-interactive-actions">
<div class="dpr-columns-section-wrapper">
<div class="dpr-columns-section-heading">
<p class="govuk-body"><strong>Columns</strong></p>
</div>
<div class="dpr-interactive-filters-accordion">
<div class="columns-section-button">
<details class="govuk-details">
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
Show columns (2 of 2 shown)
</span>
</summary>
<div class="govuk-details__text">
<form data-dpr-module="columns" class="dpr-columns-form" method="post" action="./report/apply-columns">
<input type="hidden" name="_csrf" value="csrfToken">
<div class="columns-container">
<div class="govuk-form-group govuk-!-margin-bottom-3">
<fieldset class="govuk-fieldset" aria-label="columns checkboxes">
<legend class="govuk-fieldset__legend govuk-label govuk-!-font-weight-bold">
Select report columns
</legend>
<div class="govuk-checkboxes govuk-checkboxes--small" data-module="govuk-checkboxes">
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="columns" name="columns" type="checkbox" value="field1" checked>
<label class="govuk-label govuk-checkboxes__label" for="columns">
Field 1
</label>
</div>
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="columns-2" name="columns" type="checkbox" value="childKey" checked>
<label class="govuk-label govuk-checkboxes__label" for="columns-2">
Child key
</label>
</div>
</div>
</fieldset>
</div>
</div>
<div class="govuk-button-group">
<button type="submit" class="govuk-button govuk-button govuk-!-margin-bottom-0 dpr-apply-columns-button" data-module="govuk-button">
Apply columns
</button>
<a class="govuk-link govuk-link--no-visited-state dpr-reset-columns-button" href="#">Reset columns</a>
</div>
</form>
</div>
</details>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="dpr-report-page__template-container">
<div class="dpr-report-template-container ">
<div class="dpr-report-template__page-summaries dpr-report-template__page-summaries--header">
</div>
<div class="dpr-report-template__page-totals dpr-report-template__page-totals--header">
<div class="dpr-report-totals">
<p class="govuk-body"></p>
</div>
</div>
<div class='dpr-report-template__sections dpr-report-template__sections--parent-child-section'>
<div id="dpr-report-sections">
<div id="dpr-parent-child-section-section-1" class="dpr-parent-child-section-section dpr-report-section" aria-labelledby="section-title-1">
<div class="dpr-report-section__title">
<h2 id="section-title-1" class="govuk-heading-m">Section 1: One, Section 2: A
<span class="govuk-caption-m">3 results</span>
</h2>
</div>
<div class="dpr-parent-child-group" aria-labelledby="section-title-1">
<div id="dpr-parent-child-data-1" class="dpr-parent-child-data" aria-labelledby="parent-id-1">
<h2 id="parent-id-1" class="govuk-visually-hidden">Parent 1</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 1</td>
<td class="govuk-table__cell govuk-table__cell--string">one</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 1</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 1</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data-2" class="dpr-parent-child-data" aria-labelledby="parent-id-2">
<h2 id="parent-id-2" class="govuk-visually-hidden">Parent 2</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-2" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-2">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-2"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-2">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-2" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 2</td>
<td class="govuk-table__cell govuk-table__cell--string">two</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 2</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 2</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data-3" class="dpr-parent-child-data" aria-labelledby="parent-id-3">
<h2 id="parent-id-3" class="govuk-visually-hidden">Parent 3</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-3" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-3">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-3"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-3">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-3" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 3</td>
<td class="govuk-table__cell govuk-table__cell--string">three</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 3</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 3</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-section-section-2" class="dpr-parent-child-section-section dpr-report-section" aria-labelledby="section-title-2">
<div class="dpr-report-section__title">
<h2 id="section-title-2" class="govuk-heading-m">Section 1: One, Section 2: B
<span class="govuk-caption-m">2 results</span>
</h2>
</div>
<div class="dpr-parent-child-group" aria-labelledby="section-title-2">
<div id="dpr-parent-child-data-1" class="dpr-parent-child-data" aria-labelledby="parent-id-1">
<h2 id="parent-id-1" class="govuk-visually-hidden">Parent 1</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 4</td>
<td class="govuk-table__cell govuk-table__cell--string">four</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 4</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 4</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data-2" class="dpr-parent-child-data" aria-labelledby="parent-id-2">
<h2 id="parent-id-2" class="govuk-visually-hidden">Parent 2</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-2" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-2">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-2"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-2">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-2" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 5</td>
<td class="govuk-table__cell govuk-table__cell--string">five</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 5</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 5</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-section-section-3" class="dpr-parent-child-section-section dpr-report-section" aria-labelledby="section-title-3">
<div class="dpr-report-section__title">
<h2 id="section-title-3" class="govuk-heading-m">Section 1: Two, Section 2: A
<span class="govuk-caption-m">1 results</span>
</h2>
</div>
<div class="dpr-parent-child-group" aria-labelledby="section-title-3">
<div id="dpr-parent-child-data-1" class="dpr-parent-child-data" aria-labelledby="parent-id-1">
<h2 id="parent-id-1" class="govuk-visually-hidden">Parent 1</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 6</td>
<td class="govuk-table__cell govuk-table__cell--string">six</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 6</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 6</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-section-section-4" class="dpr-parent-child-section-section dpr-report-section" aria-labelledby="section-title-4">
<div class="dpr-report-section__title">
<h2 id="section-title-4" class="govuk-heading-m">Section 1: Two, Section 2: B
<span class="govuk-caption-m">2 results</span>
</h2>
</div>
<div class="dpr-parent-child-group" aria-labelledby="section-title-4">
<div id="dpr-parent-child-data-1" class="dpr-parent-child-data" aria-labelledby="parent-id-1">
<h2 id="parent-id-1" class="govuk-visually-hidden">Parent 1</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 7</td>
<td class="govuk-table__cell govuk-table__cell--string">seven</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 7</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 7</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data-2" class="dpr-parent-child-data" aria-labelledby="parent-id-2">
<h2 id="parent-id-2" class="govuk-visually-hidden">Parent 2</h2>
<div class="dpr-parent-child-data__parent">
<div id="table-container-2" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="parent-id-2">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-2"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-2">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-2" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Field 1</th>
<th scope="col" class="govuk-table__header">Child key</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Parent 8</td>
<td class="govuk-table__cell govuk-table__cell--string">eight</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="dpr-parent-child-data__child-1" class="dpr-parent-child-data__child" aria-labelledby="child-id-1">
<h2 id="child-id-1" class="govuk-heading-s">Child Report</h2>
<div class="dpr-parent-child-data__child-table">
<div id="table-container-1" class='dpr-table-container dpr-table-container--parent-child-section' data-dpr-module="data-table" aria-labelledby="child-id-1">
<div class="dpr-overflow-gradient" id="dpr-overflow-gradient-1"></div>
<div class="dpr-table-wrapper" id="dpr-table-wrapper-1">
<div class="dpr-table-content">
<table class="govuk-table dpr-data-table" id="dpr-data-table-1" data-classification="OFFICIAL" data-col-length="">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Child Field 1</th>
<th scope="col" class="govuk-table__header">Child Field 2</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child one - Parent 8</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-table__cell--string">Child two - Parent 8</td>
<td class="govuk-table__cell govuk-table__cell--string">Other value</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="dpr-report-template__page-totals dpr-report-template__page-totals--footer">
<div class="dpr-report-totals">
<p class="govuk-body"></p>
</div>
</div>
<div class="dpr-report-template__page-summaries dpr-report-template__page-summaries--footer">
</div>
</div>
</div>
</div>
</div>
{%- from "dpr/components/_reports/report-page/view.njk" import dprReportPage -%}
{% set data = {
columns: {
name: 'columns',
options: [
{
text: 'Field 1',
value: 'field1',
disabled: false
},
{
text: 'Child key',
value: 'childKey',
disabled: false
}
],
text: 'Select report columns',
value: ['field1', 'childKey']
},
filterData: {
filters: [],
selectedFilters: [],
canSaveDefaults: true
},
count: 100,
nestedBaseUrl: '/embedded/platform',
csrfToken: 'csrfToken',
loadType: 'async',
type: 'report',
tableId: 'tblId_1769454262897',
reportId: 'report-template-examples',
id: 'report-template-parent-child-section',
actions: [],
canDownload: false,
reportName: 'Report templates',
name: 'Parent-child-section',
description: 'Template: "parent-child-section". </br> A report with parent and child datasets in sections',
classification: 'OFFICIAL',
printable: true,
specification: {
template: 'parent-child-section',
sections: ['section1', 'section2'],
fields: [
{
name: 'field1',
display: 'Field 1',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: true
},
{
name: 'childKey',
display: 'Child key',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: true
},
{
name: 'section1',
display: 'Section 1',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: false
},
{
name: 'section2',
display: 'Section 2',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: false
}
]
},
template: 'parent-child-section',
fields: [
{
name: 'field1',
display: 'Field 1',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: true
},
{
name: 'childKey',
display: 'Child key',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: true
},
{
name: 'section1',
display: 'Section 1',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: false
},
{
name: 'section2',
display: 'Section 2',
sortable: false,
defaultsort: false,
type: 'string',
mandatory: false,
visible: false
}
],
executionId: 'exId_1769454262897',
requestedTimestamp: '26/01/2026, 19:04:24',
querySummary: [],
queryData: {},
requestUrl: {
fullUrl:
'http://localhost:3010/embedded/platform/dpr/request-report/report/report-template-examples/report-template-parent-child-section/filters',
pathname:
'/embedded/platform/dpr/request-report/report/report-template-examples/report-template-parent-child-section/filters',
search: ''
},
reportUrl:
'/embedded/platform/dpr/view-report/async/report/report-template-examples/report-template-parent-child-section/tblId_1769454262897/report',
pathname:
'/embedded/platform/dpr/view-report/async/report/report-template-examples/report-template-parent-child-section/tblId_1769454262897/report',
dataTable: {
rowCount: 8,
sections: [
{
key: '[{"name":"section1","value":"One"},{"name":"section2","value":"A"}]',
keyObj: [
{
name: 'section1',
value: 'One'
},
{
name: 'section2',
value: 'A'
}
],
title: 'Section 1: One, Section 2: A',
count: 3,
summaries: [],
data: [
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 1',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'one',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 1',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 1',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
},
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 2',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'two',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 2',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 2',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
},
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 3',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'three',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 3',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 3',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
}
]
},
{
key: '[{"name":"section1","value":"One"},{"name":"section2","value":"B"}]',
keyObj: [
{
name: 'section1',
value: 'One'
},
{
name: 'section2',
value: 'B'
}
],
title: 'Section 1: One, Section 2: B',
count: 2,
summaries: [],
data: [
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 4',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'four',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 4',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 4',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
},
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 5',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'five',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 5',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 5',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
}
]
},
{
key: '[{"name":"section1","value":"Two"},{"name":"section2","value":"A"}]',
keyObj: [
{
name: 'section1',
value: 'Two'
},
{
name: 'section2',
value: 'A'
}
],
title: 'Section 1: Two, Section 2: A',
count: 1,
summaries: [],
data: [
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 6',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'six',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 6',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 6',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
}
]
},
{
key: '[{"name":"section1","value":"Two"},{"name":"section2","value":"B"}]',
keyObj: [
{
name: 'section1',
value: 'Two'
},
{
name: 'section2',
value: 'B'
}
],
title: 'Section 1: Two, Section 2: B',
count: 2,
summaries: [],
data: [
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 7',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'seven',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 7',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 7',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
},
{
parent: {
head: [
{
text: 'Field 1'
},
{
text: 'Child key'
}
],
rows: [
[
{
fieldName: 'field1',
text: 'Parent 8',
format: 'string',
classes: ''
},
{
fieldName: 'childKey',
text: 'eight',
format: 'string',
classes: ''
}
]
]
},
children: [
{
title: 'Child Report',
rows: [
[
{
fieldName: 'field1',
text: 'Child one - Parent 8',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
],
[
{
fieldName: 'field1',
text: 'Child two - Parent 8',
format: 'string',
classes: ''
},
{
fieldName: 'field2',
text: 'Other value',
format: 'string',
classes: ''
}
]
],
head: [
{
text: 'Child Field 1'
},
{
text: 'Child Field 2'
}
]
}
]
}
]
}
]
}
} %}
{{ dprReportPage(data) }}