You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: report-items/subreport.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ reportingArea: General
14
14
15
15
The SubReport item enables you to display reports within reports and serves as a container, similar to the report sections, growing in size depending on its children.
16
16
17
-
The following screenshot shows a SubReport item at design time, allowing you to compose complex reports from various report sources. The data for each SubReport can be completely different, for example, you can combine a product listing, a sales summary, and a list of salespeople each in their own sub-report with each sub-report drawing its data from a different source. You can also pass parameters to the SubReport by using the **Edit Parameters** collection editor.
17
+
The following screenshot shows a SubReport item at design time, allowing you to compose complex reports from various report sources. The data for each SubReport can be completely different; for example, you can combine a product listing, a sales summary, and a list of salespeople, each in its own subreport, with each subreport drawing its data from a different source. You can also pass parameters to the SubReport by using the **Edit Parameters** collection editor.
18
18
19
19

20
20
@@ -26,7 +26,7 @@ To set up the SubReport:
26
26
1. In the `ReportSource` property, click the __Edit Collection (…)__ button. As a result, the __Load a Report From__ window opens.
27
27
1. Click the __Edit Parameters__ button to add a parameter. As a result, the __Edit Parameters__ window opens.
28
28
1. Click the __New__ button to add a new parameter mapping.
29
-
1. Assuming you have assigned the `ReportSource` property, the __Parameter Name__ drop-down list will contain the names of parameters defined in the sub-report. Select a __Parameter Name__ from the combo box to set the target for this parameter.
29
+
1. Assuming you have assigned the `ReportSource` property, the __Parameter Name__ drop-down list will contain the names of parameters defined in the subreport. Select a __Parameter Name__ from the combo box to set the target for this parameter.
30
30
1. The __Parameter Value__ combo-box allows you to directly enter the value, and create an `<Expression>` or a `<New Report Parameter>`.
31
31
1. When you are done, click __OK__.
32
32
@@ -36,16 +36,16 @@ The following image shows the end result.
36
36
37
37
## Setting the Report Source
38
38
39
-
To specify a sub-report for a [SubReport item]({%slug telerikreporting/designing-reports/report-structure/subreport%}), you need a [ReportSource]({%slug telerikreporting/designing-reports/report-sources/overview%}) object.
39
+
To specify a subreport for a [SubReport item]({%slug telerikreporting/designing-reports/report-structure/subreport%}), you need a [ReportSource]({%slug telerikreporting/designing-reports/report-sources/overview%}) object.
40
40
41
41
The SubReport enables you to set up the report source either by using a Telerik Report Designer tool or programmatically.
42
42
43
-
When using relative path to the report in the __UriReportSource__ of the SubReport, it gets resolved by default as follows:
43
+
When using a relative path to the report in the __UriReportSource__ of the SubReport, it gets resolved by default as follows:
44
44
45
-
* In the Standalone Report Designer, Reporting REST Services and Report Viewers with respect to the main report that calls the subreport;
46
-
* In custom applications rendering reports programmatically with the [ReportProcessor class](/api/telerik.reporting.processing.reportprocessor) with respect to the application starting point.
45
+
* In the Standalone Report Designer, Reporting REST Services, and Report Viewers with respect to the main report that calls the subreport;
46
+
* In custom applications, rendering reports programmatically with the [ReportProcessor class](/api/telerik.reporting.processing.reportprocessor) with respect to the application starting point.
47
47
48
-
> When you reference reports stored in the [Telerik Report Server](https://docs.telerik.com/report-server/introduction) ensure using the *[CategoryName]/[ReportName]* path for the URI as specified in the article [Working with Report Server Reports]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/working-with-report-server-reports%}).
48
+
> When you reference reports stored in the [Telerik Report Server](https://docs.telerik.com/report-server/introduction), ensure you use the *[CategoryName]/[ReportName]* path for the URI as specified in the article [Working with Report Server Reports]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/standalone-report-designer/working-with-report-server-reports%}).
49
49
50
50
### Using a Report Designer
51
51
@@ -68,7 +68,7 @@ Due to the format of the produced reports, the [Standalone Report Designer]({%sl
68
68
69
69
The [Visual Studio Report Designer]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/visual-studio-report-designer/overview%}) provides the [report sources]({%slug telerikreporting/designing-reports/report-sources/overview%}) options.
70
70
71
-
If you are using the HTML5 Report Viewer to preview the report, the main report will be rendered in HTML and loaded on the client. The sub-report is considered as part of the main report content and its report source will be internally resolved without additional calls to the Reporting REST service.
71
+
If you are using the HTML5 Report Viewer to preview the report, the main report will be rendered in HTML and loaded on the client. The subreport is considered part of the main report content, and its report source will be internally resolved without additional calls to the Reporting REST service.
72
72
73
73
## The property DataSource of the SubReport item
74
74
@@ -80,24 +80,25 @@ All the [data sources]({%slug telerikreporting/designing-reports/connecting-to-d
80
80
81
81
A common scenario would be to feed the inner report with data coming from the data context of the `SubReport` item. To do this, define a [Binding]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/using-expressions/bindings%}) to bind the `DataSource` property to a data field.
82
82
83
-
For example, define a `Binding` with `Path``DataSource` and `Expression``=Fields.InvoiceRows` to link the inner report DataSource to the collection with the invoice rows from the main report DataSource.
83
+
For example, define a `Binding` with `Path`:`DataSource`, and `Expression`:`=Fields.InvoiceRows` to link the inner report DataSource to the collection with the invoice rows from the main report DataSource.
84
84
85
85
## Considerations and Known Limitations
86
86
87
87
When working with the SubReport item, mind the following:
88
88
89
-
* Page sections are not related to the report itself, but are relative to the paper or screen. Therefore, page sections of nested or detail reports are ignored and only the page sections of the main report are visible.
89
+
* Page sections are not related to the report itself, but are relative to the paper or screen. Therefore, page sections of nested or detail reports are ignored, and only the page sections of the main report are visible.
90
+
* The `PageSettings` are not related to the report itself, but are relative to the paper or screen. For that reason, they are ignored, and properties as `ColumnCount` won't be respected for the subreport.
90
91
* To render page sections that appear on each page, similar to page sections, consider using an unbound group (no grouping criteria specified) and set the [`PrintOnEveryPage`](/api/Telerik.Reporting.GroupSection#Telerik_Reporting_GroupSection_PrintOnEveryPage) property of its sections to `True`. Note that you cannot use the `PageCount` and `PageNumber` global objects in group sections.
91
92
* The [Table of Contents (TOC) section]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/table-of-contents/overview%}) is designed to be displayed at the top/bottom of the entire report document. For that reason, the TOC section of the subreport is ignored.
92
93
* To remove blank vertical space in the detail section of a SubReport, set the `Height` of the `SubReport.ReportSource``DetailSection` to the height of the highest item.
93
-
* Sections can grow to accommodate their children but cannot shrink to hide empty spaces. To make the detail section shrink only at runtime, set the `Height` property of the `DetailSection` in the report constructor. Place the `Height` property assignment code right after the `IntializeComponent()` method call.
94
+
* Sections can grow to accommodate their children, but cannot shrink to hide empty spaces. To make the detail section shrink only at runtime, set the `Height` property of the `DetailSection` in the report constructor. Place the `Height` property assignment code right after the `InitializeComponent()` method call.
94
95
* The default styles used in the subreports may be overridden by inherited styles from their parent reports.
95
96
96
-
When Report items and sections use default styles (i.e. their styles are not set explicitly), they will inherit the Styles from their parents. This is valid for the SubReport item and the corresponding subreport specified by its ReportSource. This may lead to inconsistencies when rendering the subreport as a separate report and in a main report. Here is an example for clarity:
97
+
When Report items and sections use default styles (i.e., their styles are not set explicitly), they will inherit the Styles from their parents. This is valid for the SubReport item and the corresponding subreport specified by its ReportSource. This may lead to inconsistencies when rendering the subreport as a separate report and in a main report. Here is an example for clarity:
97
98
98
-
Let's have a report definition (referenced below as _subreport_) that doesn't have a Font specified. It will be rendered with Font size `10pt` which is a default value, which is not explicitly set. If you have a TextBox in this report, with default Font, the text will be rendered with `10pt` when you render the _subreport_ as a separate report.
99
+
Let's have a report definition (referenced below as _subreport_) that doesn't have a Font specified. It will be rendered with Font size `10pt`, which is a default value, and is not explicitly set. If you have a TextBox in this report, with the default Font, the text will be rendered with `10pt` when you render the _subreport_ as a separate report.
99
100
100
-
Let's consider a main report, with Font size set explicitly to `20pt`. If we use the above _subreport_ in our main report, the _subreport_ text will inherit the Font size from the main report and the same text will appear with size `20pt`.
101
+
Let's consider a main report, with Font size set explicitly to `20pt`. If we use the above _subreport_ in our main report, the _subreport_ text will inherit the Font size from the main report, and the same text will appear with size `20pt`.
0 commit comments