ActiveReports 8 > ActiveReports User Guide > How To > Section Report How To > Inherit a Report Template |
In a section layout, you can create a base report as a template from which other reports can inherit. This behavior is similar to creating a master report and is available in a Section Report (code-based) layout.
Inheriting reports is useful when multiple reports share common features, such as identical page headers and footers. Instead of recreating the look every time, create template headers and footers once and use inheritance to apply them to other reports.
Use the following instructions to create a base report and inherit it in other reports.
Caution: Base reports and the reports that inherit from them cannot contain controls with duplicate names. You can compile and run your project with duplicate control names, but you cannot save the layout until you change the duplicate names. |
Controls for rptLetterhead
You can use the Page Header and Page Footer sections to design the base report. When you create reports that inherit the layout from this base report, only the detail section is available for editing.
Caution: Do not set the MasterReport property to True until you have finished designing or making changes to the report. Setting this property to True triggers major changes in the designer file of the report. |
These steps assume that you have already added another Section Report (code-based) template. This report functions like a content report where you can create the layout of the Detail section.
Caution: The existing report layout in the content report is lost once you inherit the base report. Even if you change it back to GrapeCity.ActiveReports.SectionReport, the original layout in content report will not be retrieved. |
To write the code in Visual Basic.NET
To write the code in C#
Note: To apply further changes from the base report to the content report, you might have to rebuild the project again. |