This is a migrated thread and some comments may be shown as answers.

Add subreport programmatically

1 Answer 287 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 16 Oct 2015, 12:38 PM

Hello,

I need help to get a report done as the image attached. I have 2 reports and I need to show them together in the same report. The first report will be shown always and the second will appear as many times as a parameter says. I don't know what is the best way to do it. Shall I create another report with 2 subreports? The thing is that the report 2 will have be added programmatically.

 WPF( C#) + Telerik.

I'd appreciate any light.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 21 Oct 2015, 11:13 AM
Hello J,

You can use a List item bound to a data object with as many records as sub reports you want to display. The List item's data source can be controlled by the parameter defining the number of sub reports.

In the List item you can add a SubReport item that will display the sub report, where values can be sent to sub report parameter's by accessing the container's data with an expression like =ReportItem.DataObject.FieldX, or =ReportItem.Parent.DataObject.FieldX. The Parent keyword gets the parent element's scope.
The List item can grow vertically or horizontally (there is a 'Rotate Layout' option in its Context Menu). You can also add proper groupings changing the positions of the visualized content e.g. How to: Create Multi-Column Report - Across the Page and Then Down.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
J
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or