The Barcode Generator extension provides developers with a tool to add barcodes to their reports or their client’s reports.
Before starting, ensure Barcode Generator is installed (see Install and Uninstall Barcode Generator). Once Barcode Generator is installed, you can download the symbols and use the generation functions. Complete the following to obtain the symbols:
- Create an AL project in Visual Studio Code.
- Set the launch.json file in the project to the Microsoft Dynamics 365 Business Central sandbox.
Note: The sandbox it connects to depends on your login information.
3. Include the Barcode Generation extension as a dependency in the dependencies portion of the app.json file.
4. Input AL: Download Symbols into the search window (downloads the symbol file from the sandbox into the .alpackages project folder).
Note: You now have access to the Barcode Generation procedures. These may be used in your reports that can be deployed as a per-tenant extension to the Microsoft Dynamics 365 Business Central environment.
The procedures are contained in Codeunit 23044800 – IWX Library – Barcode Gen.
The GenerateDataMatrixBarcode function generates a 2D barcode. The following parameters are organized by the function signature.
This function generates a 1D barcode. The following parameters are in order of the function signature.
These functions return an IWX Barcode record that has the barcode image set in the Image field. The Image field may then be used in a DataItem column which will show up where referenced in the report layout.
Set the value under the relevant DataItem in the report object.
Note: In the example below ‘100’ would be replaced with whatever string represents the data you would like to have included in the barcode.
Add an image element to include the column in the report layout. Based on the above example, the properties will look like the following: