reporting-docs/knowledge-base/how-to-bind-sub-report-to-m...

1.8 KiB

title description type page_title slug res_type
How to bind Sub Report to Main Report's Data How to make the Sub Report use the Main Report's Data. how-to How to send data to the Sub Report from Main Report's Data Object how-to-bind-sub-report-to-main-report-s-data kb

Environment

Product Progress® Telerik® Reporting
Report Item SubReport

Description

Telerik Reporting Expression engine allows you to reuse the data of a parent scope. This includes binding a subreport to the main report's data.

This article provides the required steps for binding the SubReport to the Main Report's Data.

Solution

  • Open the report that will be used as a subreport in the designer and use the following [binding to the report's DataSource property]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/using-expressions/bindings%}):
Property path: DataSource
Expression: =ReportItem.DataObject

When the subreport is loaded by a SubReport item in the main report, the sub report will get the data associated with the SubReport item.

  • You can change the scope to a greater parent by using the Parent keyword. For example:
Property path: DataSource
Expression: =ReportItem.Parent.Parent.DataObject

Notes

In case you need to display data in a tabular format, another approach for organizing the main report's layout can be found in [How to Databind to Collection Properties]({%slug how-to-databind-to-collection-properties%}).

See Also

[How to use the ReportItem.DataObject property in expressions]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/how-to-use-the-reportitem.dataobject-property-in-expressions%}).