← All articles

Rebuilding a legacy ERP invoice in Business Central with a report extension

By Fred Morin ·

Business version (in French): Refaire les documents de votre ancien ERP dans Business Central

Share this articleLinkedInFacebookEmail

A Quebec distributor moving to Business Central from its old ERP wanted one thing on the document side: an invoice that looks like the old one. Their customers' accounting departments know exactly where to find the order number, the terms and the taxes, and a new layout means calls and late payments for no good reason.

Here's how I built it, and the parts that took more thought than expected.

Extend the standard report, don't copy it

Copying report 1306 (Standard Sales - Invoice) and editing the copy is the fast route, and the copy stops getting Microsoft's fixes the day you make it. A report extension keeps the standard dataset and logic (lines, taxes, totals, discounts), lets you add columns and code, and ships its own layout:

reportextension 50450 "Sales Invoice Ext" extends "Standard Sales - Invoice"
{
    dataset
    {
        add(Header)
        {
            column(RequestedDeliveryDate; RequestedDeliveryDate) { }
            column(ShippingAgentName; ShippingAgentName) { }
            column(ConditionsText; ConditionsText) { }
            column(DocLanguage; DocLanguage) { }
        }
        modify(Header)
        {
            trigger OnAfterAfterGetRecord()
            begin
                // fill the added columns for this invoice
            end;
        }
    }

    rendering
    {
        layout(LegacyInvoice)
        {
            Type = RDLC;
            LayoutFile = './layouts/LegacyInvoice.rdlc';
            Caption = 'Invoice (legacy look)';
        }
    }
}

Filling the gaps

What the old invoice showed and the standard dataset doesn't:

  • The requested delivery date. The posted invoice doesn't carry it. It's read back from the posted shipment of the same order (Sales Shipment Header filtered on Order No.).
  • The shipping agent's name, from the Shipping Agent record, instead of the code.
  • The QST number, from Company Information (the GST number is already in the standard dataset), never typed into the layout.
  • The terms at the bottom, in French and English. These live in Business Central as a standard text with extended texts per language and date range, which the extension creates at install. Changing a sentence is a data change, not a deployment.

The document's language, not the user's

The trap: anything you add to a report naturally comes out in the language of the person printing it. The standard report switches its own captions to the customer's language; everything the extension adds has to follow the same rule. The extension works out the document language from the invoice's Language Code, picks the terms text in that language, and passes the language to the layout as a column so the RDLC's own captions follow it too. An English-speaking customer gets an English invoice even when a French-speaking clerk prints it.

RDLC details that make it look like the old one

  • Header and footer can't read dataset fields in RDLC. The usual fix: put each value once in a hidden textbox in the body, and read it from the header or footer with ReportItems!. One copy per value, read by both.
  • Hide the discount columns when no line has a discount, and let the description take the full width. That's a visibility expression on the columns driven by a value computed once for the document.
  • Match the formats and sizes of the old invoice: date formats, decimals, fonts. Users notice these first.

Word or RDLC

I showed the client both layout types on the same invoice before building. Word layouts can be edited by the client in Word; RDLC gives tighter control over placement but needs Report Builder or Visual Studio. They picked RDLC. My default advice is Word when the client wants to make small changes themselves, RDLC when the layout has to be exact.

Two practical notes on current versions:

  • Layout status. Since 2026 release wave 1, report layouts have a status (draft, pending approval, approved, retired) and only approved layouts print. A layout imported by hand starts as a draft.
  • Report Builder opens an exported .rdlc once it's renamed .rdl.

What's next

The invoice is usually the first document, not the last: credit memo, order confirmation, quote, packing slip. Once the language handling, the extended texts and the company fields are in place, the next ones go much faster.

Rebuilding documents for a Business Central project? Let's talk.

Share this articleLinkedInFacebookEmail