WordMergeDataItem Property

Version: Available or changed with runtime version 1.0.

Specifies the root-level DataItem that is used to generate separate reports for multiple records.

Applies to

  • Report

Syntax

WordMergeDataItem = MyDataItem; // MyDataItem must be present as a top-level dataitem in the report dataset

Remarks

The WordMergeDataItem property is only applied when rendering a report using a Word layout.

When you specify a dataitem in the WordMergeDataItem property, the Business Central server will do a "Mail merge" between that data item (and the ones below it) and the Word layout when rendering the report using the Word layout.

Example

The following example is showing how the WordMergeDataItem property is used on the "Standard Sales - Invoice" report when rendered with a Word layout.

Here, the Word layout will be applied to each element in the Header dataitem. Thus, if you have defined a different first page, page numbers, totals at the end, and similar report design elements in the Word layout, they'll be "reset" for each element in the Header dataitem.

report 1306 "Standard Sales - Invoice"
{
    // Other report properties set here

    WordMergeDataItem = Header;

    dataset
    {
        dataitem(Header; "Sales Invoice Header")
        {
            ...
        }
    }

    ...

    rendering
    {
        layout("StandardSalesInvoice.docx")
        {
            Type = Word;
            LayoutFile = './Sales/History/StandardSalesInvoice.docx';
            Caption = 'Standard Sales Invoice (Word)';
            Summary = 'The Standard Sales Invoice (Word) provides a simple layout that is also relatively easy for an end-user to modify.';
        }

        // more layouts here
    }
}

See Also

Creating a Word layout report
Working with Word layouts
Report object
Report overview