Add subreport programmatically

2 posts, 1 answers
  1. J
    J avatar
    20 posts
    Member since:
    Sep 2015

    Posted 16 Oct 2015 Link to this post


    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.


  2. Answer
    Stef avatar
    3610 posts

    Posted 21 Oct 2015 Link to this post

    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.

    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
Back to Top