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
- Declare a barcode font provider
- Select the required barcode
- Validate the input string you want to print on the barcodes (not mandatory)
- Encode the string and display it in the report (RDLC or Word Layout)
Example of use:
RDLC REPORT LAYOUT
RUN TEST REPORT
Source & Docs
Ready to use example
Microsoft note on my question
“You need to use the prod names for the fonts in the RDLC layout file”
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.