web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Help with creating custom report layout in using word format

(0) ShareShare
ReportReport
Posted on by 30

Hello Everyone.

Please am having a little challenging designing a custom layout report for sales invoice using word format.

pastedimage1654424405092v1.png

The challenge from above is , I want to be able to SUM all total quantity_line to get the value at the bottom. 

Best regards.

 [View:/cfs-file/__key/communityserver-discussions-components-files/758/DefaultV3.docx]

I have the same question (0)
  • Suggested answer
    raelhefn Profile Picture
    on at

    Hi,

    From XML Mapping, under header / Insert totals select Quantity.

    pastedimage1654501393098v1.png

    pastedimage1654435101930v1.png

  • Austin360 Profile Picture
    30 on at

    Hello , thanks Rami,

    am not sure I have that instrasTotal on mine. please I have the template attached above

    pastedimage1654437156248v1.png

  • raelhefn Profile Picture
    on at

    Check under Totals / LineTotals.

    Please send BC/NAV version / build number. template name.

    Work with Word Layouts: docs.microsoft.com/.../ui-how-add-fields-word-report-layout

  • Suggested answer
    YUN ZHU Profile Picture
    95,599 Super User 2025 Season 2 on at

    Hi, the Report Extension is required if you want to add a quantity total to report 1306 "Standard Sales - Invoice". Below is a simple example.

    pastedimage1654474771634v4.png

    pastedimage1654474808966v5.png

    Test:

    pastedimage1654474836815v6.png

    pastedimage1654474849183v7.png

    Source code:

    reportextension 50102 MyExtension extends "Standard Sales - Invoice"
    {
        dataset
        {
            add(Totals)
            {
                column(TotalQuantities; TotalQuantities)
                {
                }
            }
    
            modify(Header)
            {
                trigger OnAfterAfterGetRecord()
                begin
                    TotalQuantities := 0;
                end;
            }
    
            modify(Line)
            {
                trigger OnAfterAfterGetRecord()
                begin
                    TotalQuantities  = Quantity;
                end;
            }
        }
    
        var
            TotalQuantities: Decimal;
    }

    Hope this helps

    Thanks.

    ZHU

  • Austin360 Profile Picture
    30 on at

    Thanks , I will revert.

  • Austin360 Profile Picture
    30 on at

    Hello ZHU,

    this is interesting.

    I am thankful.

    I will revert back as soon as possible.

  • Austin360 Profile Picture
    30 on at

    Hello ZHU,

    Am really new to this.

    I have being looking into report extension and the tools I need, which are VS code.

    however, I am not sure how to walk my way from there.

    please, is there a video to watch on how to using Vs code(downloading the extensions ) and hooking it up to business central please.

    Best regards.

  • Suggested answer
    raelhefn Profile Picture
    on at

    Hi,

    www.youtube.com/watch

    Get Started with AL

    docs.microsoft.com/.../devenv-get-started

  • Suggested answer
    YUN ZHU Profile Picture
    95,599 Super User 2025 Season 2 on at

    Just adding to Rami's reply, MS Learn is also a good choice.

    https://docs.microsoft.com/en-us/learn/modules/introduction-development-process/

    https://docs.microsoft.com/en-us/learn/modules/report-extensibility/

    Hope this helps.

    Thanks.

    ZHU

  • Austin360 Profile Picture
    30 on at

    Hello ZHU,

    please an having the following Error

    OnAfterGetRecord is not available in runtime version 7.0 supported runtime version are 7.1 or greater .AL(AL0666)  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans