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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Barcode Storage in Table

(0) ShareShare
ReportReport
Posted on by 106

Can I store the BarCOde string as an image in the Blob field for every item, it is to be done on table level, not on reports?

Suggested video from Erik Hougaard converts the value in 0 and 1 format which is not expected value. Barcode is made up with the combination of Item no+qty+UOM for every entry.

with the native report of BarCode we can easily print on the report, but how can I store it in a blob

as the BarCode image has to be sent to the third part as a Base64 string.

I referred to this code and further added a table to store input

https://yzhums.com/11763/

https://robertostefanettinavblog.com/2021/04/07/barcode-in-business-central-cloud/

after using above mentioned function,ignore codabara only used 

 GenerateCode128();
        GenerateCode39();
        GenerateCode93();
as some other functions have error now

it is a sample written to store data

        /
    local procedure InsertValues(itemno: Code[20]; Input: text; BarCodeSymbology: Enum "Barcode Symbology")
    var
        ItemBarcode: Record "Bar Code Table";
        Base64: Codeunit "Base64 Convert";
        oStream: OutStream;
        istream: InStream;

    begin
        ItemBarcode.Init();
        ItemBarcode.BarCodeText := itemno;
      
        ItemBarcode.Image.CreateOutStream(oStream);

        oStream.WriteText(Input);
        ItemBarcode.Image.CreateInStream(istream);

        CopyStream(oStream, istream);
        ItemBarcode.Symbols := BarCodeSymbology;
        ItemBarcode.Insert();
    end;
I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    If you are on latest version of BC you don't need any third party websites or code to generate code, you can use standard BC, please see below

    docs.microsoft.com/.../devenv-report-add-barcodes

    and you can store that encoded text in the standard field.

  • Techworld Profile Picture
    106 on at

    For this I wrote that local procedure InsertValues() but I am not able to convert that in image, it is corrupting image. Is there a way I can store an image or generate value as Barcode looks

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    Check this repository, you need to use an API to generate and store in table as Blob

    github.com/.../Cod50121.GenerateBarcode.al

  • Techworld Profile Picture
    106 on at

    yes, this was the way people used to do for QRCode and BarCode as third party BarCode4me has stopped there services, many others have come in market with their third party APIs for use.

    some are paid and some has some limitations above which they are paid.

    Actually, I was looking for if new BarCode support introduced in Business central  encoded value can be stored as an image like a BarCode.

    So it can be send as Base64 string to third party system

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,250 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,799 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,390

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans