This question is locked. New answers and comments are not allowed.
Hello,
I have a report that contains a SubReport. The sub report ReportSource is set to a type name.
What I would like to define in the designer is that the DataSource of the sub report is the same as the DataSource of the main report. How can I do this?
Patrick
I have a report that contains a SubReport. The sub report ReportSource is set to a type name.
What I would like to define in the designer is that the DataSource of the sub report is the same as the DataSource of the main report. How can I do this?
Patrick
4 Answers, 1 is accepted
0
Hi Patrick,
Open the sub report designer and use the following binding to the report's DataSource property:
Thus when added in a SubReport item, the report will get its data from the DataObject of the SubReport item. Using the Parent key word you can go up the hierarchy of elements and get the whole report data e.g. =ReportItem.Parent.Parent.Parent.DataObject for a sub report placed in a Detail section of report without groupings.
I hope this helps you.
Regards,
Stef
Telerik
Open the sub report designer and use the following binding to the report's DataSource property:
Property path: DataSource
Expression: =ReportItem.DataObject
Thus when added in a SubReport item, the report will get its data from the DataObject of the SubReport item. Using the Parent key word you can go up the hierarchy of elements and get the whole report data e.g. =ReportItem.Parent.Parent.Parent.DataObject for a sub report placed in a Detail section of report without groupings.
I hope this helps you.
Regards,
Stef
Telerik
New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.
0

Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 20 Jan 2014, 11:00 AM
Hi Stef,
I tried to add this binding but, when generating the report, I have the following error message:
An error has occurred while processing DetailSection 'detail':
Bindings error - Property 'DataSource' does not exist.
Patrick
I tried to add this binding but, when generating the report, I have the following error message:
An error has occurred while processing DetailSection 'detail':
Bindings error - Property 'DataSource' does not exist.
Patrick
0
Hi Patrick,
The binding should be applied to the report that will be displayed in the SubReport item. Open it in the Report Designer, go to the Property Grid - Bindings and set its DataSource property to the expression. When you hit preview in the master report, the sub report will be loaded with data.
If you need further help, please elaborate on the reports structures.
Regards,
Stef
Telerik
The binding should be applied to the report that will be displayed in the SubReport item. Open it in the Report Designer, go to the Property Grid - Bindings and set its DataSource property to the expression. When you hit preview in the master report, the sub report will be loaded with data.
If you need further help, please elaborate on the reports structures.
Regards,
Stef
Telerik
New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.
0

Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 23 Jan 2014, 07:33 AM
Hi Stef,
thank you for clarification: it is working now.
As I think it is a common scenario, the documentation for SubReport should be updated with this information.
Patrick
thank you for clarification: it is working now.
As I think it is a common scenario, the documentation for SubReport should be updated with this information.
Patrick