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

Community site session details

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

How Print QR Code on word layout in Business Central

(4) ShareShare
ReportReport
Posted on by 229
i want to print barcode in word layout of BC Reports 
i used both but from 50107 it print in base64 which already saved in qr code field
AQ9ST05VUyBVU0EsIEluYy4CDzM5OTk5OTk5OTkwMDAwMwMTMjAyNS0wNC0yOVQxMTow
MDowMAQGNDMxLjQ2BQU1Ni4yOAYsa0lzREw2dERoZVFqYVRLWGs5QW5SL1RIUk1icnJ0RD
huSkY2aTBaanVNUT0HYE1FWUNJUUNCUnVmeFNTc2ViZ1Q5dU85dWhFaGxDSGRqSm9rTEZ
lem9jV2tNRS9MNzRnSWhBS2RQWERocms5T2Vmb2JNcGZGN0taYklwMnBqQ1JudU02amVv
KzBtVm81cwhYMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyH/y6xbTfPADmZw+kSS3j8ZbrTICk
wy78e9uiKJP1IPUTI+ZQePww+H6EbqWVS/HZqOKV1vDbbn/C5mfmwra/A==
S-CR1022
10951073-6563-5649-4075-000009379014
and second one 50108 it print in this form 

AHEEEHA
BNFFFNBPMLJCACBKIOEOILNCAHFHAKJGAGIDEOAHJLMHBGAHFHADMGBPBLEHALIPAOB
HFPBNFFFNB
GKEGLEFFNMHEDFFGEGOCFDAIDBBDALDJJBFIPKEGHLCIPLABDEAOPGOHGLFKKMOMFM
MPLMHMPFJBH
AJAONBFNBLNOOHEFJAOCJEKBJDMDIGFCKNHFCCLKKPGBJFADDGJHDJNIIMIMHMMGCBAF
EJFCMMLAM
AEAGBIFGNFEJOPBKDIIHJINBGKGBEDAFFADLPJFEOJMFBFFGIJBOAHCNBHOBODJINMOKLM
CHBMEPK
IPAKEFFFGLM
report 50107 "Invoice List Report"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    Caption = 'Invoice List Report';
    DefaultLayout = Word;
    WordLayout = 'Layouts\InvoiceListReport.docx'; // upload layout in project
 
    dataset
    {
        dataitem(Invoice; InvoiceTable)
        {
            column(InvoiceNo; Invoice.InvoiceNo) { }
            column(UUID; Invoice.UUID) { }
            column(QRCode; QRCode) { }
 
            trigger OnAfterGetRecord()
            begin
                GenerateQRCode();
            end;
        }
    }
 
    requestpage
    {
        layout
        {
            area(content)
            {
                group(Group)
                {
                    field(InvoiceNo; Invoice.InvoiceNo) { ApplicationArea = All; }
                }
            }
        }
    }
 
    var
        QRCode: Text;
 
    local procedure GenerateQRCode()
    var
        BarcodeSymbology2D: Enum "Barcode Symbology 2D";
        BarcodeFontProvider2D: Interface "Barcode Font Provider 2D";
    begin
        BarcodeFontProvider2D := Enum::"Barcode Font Provider 2D"::IDAutomation2D;
        BarcodeSymbology2D := Enum::"Barcode Symbology 2D"::"QR-Code";
 
        // take invoice UUID or your ZATCA QR text here
        QRCode := BarcodeFontProvider2D.EncodeFont(Invoice.UUID, BarcodeSymbology2D);
    end;
}
report 50108 "qr Report"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    Caption = 'Invoice List Report';
 
    DefaultLayout = Word;
    WordLayout = 'Layouts\qrReport.docx'; // Upload your Word layout here
 
    dataset
    {
        dataitem(Invoice; InvoiceTable)
        {
            column(InvoiceNo; Invoice.invoiceNO) { }
            column(UUID; Invoice.UUID) { }
 
            // Encoded text for QR (will render as barcode in Word using BC QRCode font)
            column(QRCodeTxt; QRCodeTxt) { }
 
            trigger OnAfterGetRecord()
            begin
                GenerateQRCode();
            end;
        }
    }
 
    requestpage
    {
        layout
        {
            area(content)
            {
                group(Group)
                {
                    field(InvoiceNo; Invoice.invoiceNO) { ApplicationArea = All; }
                }
            }
        }
    }
 
    var
        QRCodeTxt: Text;
 
    local procedure GenerateQRCode()
    var
        BarcodeSymbology2D: Enum "Barcode Symbology 2D";
        BarcodeFontProvider2D: Interface "Barcode Font Provider 2D";
    begin
        if Invoice.QRCode = '' then
            exit;
 
        BarcodeFontProvider2D := Enum::"Barcode Font Provider 2D"::IDAutomation2D;
        BarcodeSymbology2D := Enum::"Barcode Symbology 2D"::"QR-Code";
 
        QRCodeTxt := BarcodeFontProvider2D.EncodeFont(Invoice.QRCode, BarcodeSymbology2D);
    end;
}
I have the same question (0)
  • Suggested answer
    Rishabh Kanaskar Profile Picture
    4,392 on at
    How Print QR Code on word layout in Business Central
    Hi,
     
    In Business Central, Word layouts don’t automatically render QR codes from Base64 or barcode strings. To print a scannable QR code in a Word layout, you need to convert the Base64 or QR string to an image first and then bind that image to the Word layout.
    Steps:
    > Create an Image control in your Word layout where you want the QR code.
    > In AL, convert the QR code field (Base64) to an InStream and set it as a Blob image on the report dataset.
    > Bind the Image control to this Blob field in Word.
    > Directly printing Base64 or QR text as-is will only render the text, not the scannable code.
     
    Thanks
    Rishabh
  • Suggested answer
    YUN ZHU Profile Picture
    92,429 Super User 2025 Season 2 on at
    How Print QR Code on word layout in Business Central
    Is it a font problem?
    Try the following solutions.
    Dynamics 365 Business Central Blog Series: Adding Barcodes
     
    Thanks
    ZHU
  • Gerardo Rentería García Profile Picture
    23,574 Most Valuable Professional on at

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,119

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,902

#3
Sumit Singh Profile Picture

Sumit Singh 3,021

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans