Skip to content

Commit 0452d76

Browse files
Creating Reusable Headers and Footers (#1952)
* Creating Reusable Headers and Footers * small changes * Update user-guide/components/SubReport/creating-nested-hierarchy-with-subreports.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> * Update user-guide/components/subreport/creating-reusable-headers-and-footers.md Co-authored-by: Yordan <[email protected]> --------- Co-authored-by: Yordan <[email protected]>
1 parent a82e786 commit 0452d76

File tree

4 files changed

+69
-7
lines changed

4 files changed

+69
-7
lines changed

user-guide/components/SubReport/creating-nested-hierarchy-with-subreports.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ The main benefits of this approach are:
1919
* Works naturally with hierarchical object models or JSON data.
2020
* Cleaner and more maintainable for multi-level hierarchies.
2121

22-
The example in this tutorial shows how to present and organize a report when the used data has a nested (hierarchical) structure. To illustrate the hierarchical structure of the data used in the tutorial, see the JSON data below. It represents a collection of Categories, where each category contains a **nested** list of its Products.
23-
24-
Let's have the sample [JSON data](https://github.com/telerik/reporting-samples/blob/master/Sample%20Reports/Data%20Files/Categories-Products-Nested-Data.json) representing a collection of Categories. Each category contains a nested list of its Products. This is a piece of the JSON content to better understand the Categories-Products hierarchical structure.
22+
The example in this tutorial shows how to present and organize a report when the used data has a nested (hierarchical) structure. The [JSON data for this report](https://github.com/telerik/reporting-samples/blob/master/Sample%20Reports/Data%20Files/Categories-Products-Nested-Data.json) represents a collection of Categories. Each category contains a **nested** list of its Products.
2523

2624
A complete step-by-step video is available here:
2725

@@ -47,7 +45,9 @@ To design a report that represents a hierarchy:
4745

4846
1. Navigate to the **INNER REPORT** section and select the **UriReportSource** Type. Now, you need to create a separate report that will be used as a container for the products for each category.
4947

50-
1. Create another report (`ProductsReport.trdp`) and add two TextBox items.
48+
1. Create another report (`ProductsReport.trdp`).
49+
50+
1. Remove the default header/footer and add two TextBox items (or other Report items according to the data you need to display).
5151

5252
1. Using the search box, navigate to the **Value** field and bind to `=Fields.ProductName` and `=Fields.Price` respectively. Save the child report.
5353

user-guide/components/SubReport/creating-org-hierarchy-with-subreports.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ CEO
2626
│ │ ├── Accountants
2727
</pre>
2828

29-
The approach demonstrated here uses a recursive SubReport to construct an hierarchy from flat data. The main report references itself in a SubReport item, and each SubReport filters its data using a report parameter passed from its parent. This process continues recursively, building the hierarchy until no more child items remain:
30-
29+
The approach demonstrated here uses a recursive [SubReport]({%slug web-report-designer-user-guide-components-subreport%}) to construct an hierarchy from flat data. The main report references itself in a SubReport item, and each SubReport filters its data using a report parameter passed from its parent. This process continues recursively, building the hierarchy until no more child items remain:
3130

3231
<iframe width="560" height="315" src="https://www.youtube.com/embed/pzGIhgwfwZk?si=Cl3zj-v9Cuy4DJDb" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
3332

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Creating Reusable Headers and Footers
3+
page_title: Creating Reusable Headers and Footers
4+
description: Learn how to use SubReports in the Web Report Designer to create reusable header and footers.
5+
slug: creating-reusable-headers-and-footers
6+
tags: web, report, design, components, subreport, header, footer, reuse
7+
published: True
8+
reportingArea: WRDHTML5, WRDBlazorWrapper
9+
position: 4
10+
---
11+
12+
# Creating Reusable Headers and Footers with SubReport
13+
14+
The SubReport item is perfect for creating reusable report components that can be embedded in larger reports later.
15+
16+
Here's a step-by-step tutorial for creating a reusable part of a report (for example, header and footer) using a SubReport:
17+
18+
<iframe width="560" height="315" src="https://www.youtube.com/embed/sMgP2iNkvvM?si=A7g7W7pBGyzlEt9y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
19+
20+
## Creating the Header Report
21+
22+
1. Create a new report (for example, `HeaderReport.trdp`).
23+
24+
1. Remove the default header and footer.
25+
26+
1. Add elements like company logos and report titles in the Page Header section.
27+
28+
1. Preview and save this report as a standalone file. This will serve as your reusable header part of a bigger report.
29+
30+
## Creating the Footer Report
31+
32+
1. Create a new report (for example, `FooterReport.trdp`).
33+
34+
1. Remove the default header and footer.
35+
36+
1. Add elements like information text or any other meaningful content to the footer part of a report.
37+
38+
1. Preview and save this report as a standalone file. This will serve as your reusable footer part of a bigger report.
39+
40+
## Adding SubReports to Your Main Report
41+
42+
1. Create a new report that will serve as the main report.
43+
44+
1. Select the Details section and add a SubReport item.
45+
46+
1. Navigate to the **INNER REPORT** section and select the **UriReportSource** option.
47+
48+
1. For the **Uri** field, select the `HeaderReport.trdp`.
49+
50+
1. Preview the report to see that the header content is successfully included.
51+
52+
1. Select the Details section again and add another SubReport item.
53+
54+
1. Navigate to the **INNER REPORT** section and select the **UriReportSource** option.
55+
56+
1. For the **Uri** field, select the `FooterReport.trdp`.
57+
58+
59+
60+
## See Also
61+
62+
* [Web Report Designer]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/overview%})
63+
* [Data Sources]({%slug web-report-designer-user-guide-components-data-sources%})

user-guide/components/subreport/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A SubReport is a report component that allows you to embed one report inside ano
2323
SubReports act as containers that automatically adjust their size based on the content of the embedded report. You can use SubReports to create:
2424

2525
* [Master-detail relationships]({%slug web-report-designer-user-guide-creating-master-detail-report%})&mdash;Display related data in a parent-child format (for example, categories and their products). The master report with categories passes a report parameter (CategoryID) to the child report with products to filter the relevant hierarchical data.
26-
* Reusable components&mdash;Create shared headers, footers, or report sections that can be used across multiple reports.
26+
* [Reusable components]({%slug creating-reusable-headers-and-footers%})&mdash;Create shared headers, footers, or report sections that can be used across multiple reports.
2727
* Complex layouts&mdash;Combine different data sources and report structures within a single report.
2828
* [Hierarchical data]({%slug wrd-user-guide-create-nested-hierarchy-with-subreport%})&mdash;Show nested data relationships with proper grouping and organization. The Web Report Designer provides an alternative approach to parameter binding for hierarchical data using the **DataSource** property of the **SubReport** item. This method is cleaner when your detail report is fully data-bound (not just a table inside it) and works well for hierarchical nested data scenarios.
2929
* [Organization Structure]({%slug wrd-user-guide-create-org-hierarchy-with-subreport%})&mdash;Use recursive SubReports and a self-referencing flat data source. The hierarchy is achieved by having the main report reference itself as a SubReport, passing a parameter that filters child records based on the parent’s ID.

0 commit comments

Comments
 (0)