Edit

DefaultHeaderFooterPart Property

Version: Available or changed with runtime version 18.0.

Sets the default header/footer part, defined as a layout with the HeaderFooter subtype, that should be used for the Word layouts of this report.

Applies to

  • Report

APPLIES TO: Business Central 2026 release wave 2 and later

Remarks

DefaultHeaderFooterPart sets the header and footer part for the Word layouts of the report that have SubType = Body. The value is the name of a layout declared in the rendering section of the report, in the same way as the DefaultRenderingLayout property.

The referenced layout must be a Word layout that has SubType = HeaderFooter, and it must point to a .docx file. If it references a layout that has another type or subtype, the compiler reports an error.

Use this property when all Body Word layouts in the report share one header and footer. To set the part for a single layout, use the HeaderFooterPart property on that layout.

Example

The following example sets a header and footer part and a theme part for the whole report. The Body layout doesn't repeat these references.

report 50102 "Customer List Report"
{
    ApplicationArea = All;
    UsageCategory = ReportsAndAnalysis;
    DefaultRenderingLayout = CustomerBody;
    DefaultHeaderFooterPart = CorporateHeaderFooter;
    DefaultThemePart = CorporateTheme;

    dataset
    {
        dataitem(Customer; Customer)
        {
            column(Name; Name)
            {
            }
        }
    }

    rendering
    {
        layout(CustomerBody)
        {
            Type = Word;
            SubType = Body;
            LayoutFile = 'Reports/Layouts/CustomerBody.docx';
        }
        layout(CorporateHeaderFooter)
        {
            Type = Word;
            SubType = HeaderFooter;
            LayoutFile = 'Reports/Layouts/CorporateHeaderFooter.docx';
        }
        layout(CorporateTheme)
        {
            Type = Word;
            SubType = Theme;
            LayoutFile = 'Reports/Layouts/CorporateTheme.dotx';
        }
    }
}

Declare report layouts in AL
DefaultThemePart property
HeaderFooterPart property
ThemePart property
DefaultRenderingLayout property
Defining multiple report layouts
Getting started with AL
Developing extensions