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

Sub Reports

1 Answer 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 24 Nov 2007, 01:02 PM
Hi,
    I am developing report application in vb.net 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.

Thanks,
Rahul
    
               

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 26 Nov 2007, 10:47 AM
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,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or