Barcode in Business Central Cloud!

BC2021W1 with a “Cloud Barcode” system

Others have already posted about it, since it has always been a hot topic (since 2018!) I also set an example of use. Today Business Central 2021 Wave 1 natively provides the management of barcodes in reports (functionality announced long ago and released today).

Barcode Ready-to Go

  • Code39, Code128, EAN8, EAN13 …

 

About Barcode in Business Central

“The barcode functionality lets you convert an alphanumeric value in a report dataset into a barcode on a generated report. The functionality is provided by the Barcode module of the System Application. “

Using a barcode font in the report layout

“Each supported symbology has a corresponding font installed in Business Central online. To use a barcode font in the report layout, mark the encoded string from the dataset with the font.

It’s possible as a developer to use a font in a layout without having it installed on the machine that you use to develop the layout. Without the font, the report won’t show the barcode. But if you then test the report in an online sandbox, it will be shown on the report.

Install the demo versions of the fonts in your developer environments so that you can design custom reports.

For a Windows environment, install the fonts.

For a sandbox Docker environment, download and then install the demo fonts locally. Then use the Add-FontsToNavContainer PowerShell cmdlet to add fonts to the container.”

 

How the system works

Barcode management is included in the System Application

The module includes the objects and tools needed to add barcodes to reports, just recall them to be able to use them.

I believe that the fonts are installed in the Azure Tenant that hosts my BC Cloud instance, in fact if I use it on On-Premise I have to install the fonts in my system, in the Cloud it is not needed, they are provided as a service.

 

How to use it

4 Steps

  1. Declare a barcode font provider
  2. Select the required barcode
  3. Validate the input string you want to print on the barcodes (not mandatory)
  4. Encode the string and display it in the report (RDLC or Word Layout)

Example of use:

RDLC REPORT LAYOUT

RUN TEST REPORT

Source & Docs

https://github.com/microsoft/ALAppExtensions/tree/master/Modules/System/Barcode

https://docs.microsoft.com/en-us/dynamics365-release-plan/2021wave1/smb/dynamics365-business-central/use-one-dimensional-barcodes-reports-business-central-online

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-barcode-fonts

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-add-barcodes

Ready to use example

https://github.com/rstefanetti/AL-Code-Samples-Education/tree/CloudBarcode

STAY TUNED!

 

Microsoft note on my question

You need to use the prod names for the fonts in the RDLC layout file

See https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-barcode-fonts for details”

It only works correctly if the names to be used are those highlighted

Obviously, if you do not have the font installed locally, the name must be replaced directly in the rdlc file by vscode.

Share and Enjoy !

Shares

One thought on “Barcode in Business Central Cloud!

  • 17 June 2021 at 4:59 PM
    Permalink

    Thanks for the post i found it very useful!!

    One doubt, is available anywhere the fontfamily name for all the possible barcodes admited by BC? Like the photo you show with the list of Code 128 but for the rest of the codes (EAN13…)

    Reply

Leave a Reply to Iñigo Pardos Lobo Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.