Sub Reports

2 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 24 Nov 2007 Link to this post

        I am developing report application in using telerik reporting tool.
    I want to show multiple reports on a parent report page. For that I have followed the following steps:
      1. I created 2 reports which are child reports binded by different DataSource.
      2. Then I created one parent report.
      3. On parent report I placed 2 SubReport control with 2 respective child report as report source.
          However, I am having problem with preview . The data is repeating that number of times as number of records. eg. if the sub report2 is generating  4 records then that report comes 4 times.
             Besides this in report viewer I am getting error as "Object reference not set to an instance of an object."
                If possible please give me the steps to be followed if I am going anywhere wrong.


  2. Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 26 Nov 2007 Link to this post

    Hello Rahul Khinvasara,

    We will be able to help you design your reports, if you elaborate a little bit more on the exact goal that you are trying to achieve. Here are some things that should be known when designing SubReports:

    1. The DetailSection of a report will be repeated as many times as there are data rows in the data source that the report is bound to. So if the Parent report has a data source, its DetailSection will be repeated and if the SubReport items are inside it -- they will be repeated as well.

    2. If you want to use the Parent report simply as means of combining multiple reports, then you should leave it unbound. This way, its DetailSection will be repeated only once. The SubReports will appear only once too.

    3. Each SubReport item will render its source report. It renders just like a normal report, with the only exception that it does not show page headers and footers, since it is being rendered in its parent's page context.

    For a real life example of using SubReports, please take a closer look at the ProductLineSales sample that comes with Telerik Reporting.

    You can also use this help topic as a guide when creating SubReports.
    I hope this information helps.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top