Have you ever worked on a report and wanted a way to show multiple reports one right after the other? For example, if you wanted to print a corporation’s annual report, you would first print the Balance Sheet, then the Income Statement and finally the Statement of Cash Flows. Each of these reports is different, but you want them all to appear together. Or have you wanted to print information from two different tables even though they weren’t related to each other? For example, you could have printed out monthly invoices for each customer and put your company information in the header of the invoice. Even though the company information isn’t directly related to the sales data, you still want to show it on the report. In both of these circumstances, and many more, subreports are used to solve these problems that standard reports can’t handle.
A limitation of the standard report is that only a single view of the data source can be displayed. This means that you can only print data that comes from a single table (or a group of related tables). You can’t print data that comes from two unrelated tables. You would have to create a separate report to print each data source. Rather than create separate reports to present additional views of the data sources, you can combine the multiple reports into a single report. This gives the impression to the reader that it is all one big report. These multiple reports are referred to as subreports because they are included within a main report.
From a functional and design standpoint, a subreport is virtually identical to a standard report. It has the same layout as a standard report and it uses the same report objects. The subreport differs from a standard report in that it is an object on a report. Thus, it is part of another report. There are also a few rules and restrictions associated with subreports, but we’ll cover those later.