Nested reports (subreports)

Top  Previous  Next

Sometimes very complex report are needed which contain blocks of additional data inserted at particular points in the design. Although many of these reports can be designed using an arrangement of FastReport bands, sometimes it just becomes too complicated. In these circumstances it is necessary to use the “Subreport” object _img158 .


When a “Subreport” object is inserted into a design FastReport automatically adds a new page, which is connected to the “Subreport”. Such a nested report resembles a multi-page report in terms of design structure. The only difference is that the nested report is displayed in a specific location on the basic design page, and not after it. When this report is output, as soon as the “Subreport” object is encountered the report engine outputs the connected subreport page in its entirety. After that output continues with the rest of the basic design page.


Further “Subreport” objects can be inserted into a subreport design page, so increasing the depth of nesting. An example of a nested report can be found in the demo program - the “Subreports” report.


It is worth noting that FastReport’s ability to use subreports enables deep nesting of data. Remember that the number of data levels in FastReport is limited to only six when Detail data bands are used instead of the “Subreport” object.