Generate barcode in Microsoft® Dynamics NAV®
Microsoft® Dynamics NAV®, formerly known as Navision, is a complete ERP (Enterprise Resource Planning) system for mid-size organizations.
If you want to generate linear or 2D barcode in Microsoft Dynamics NAV, you don't need to look any further.
Barcodesoft font-based software is a smart and simple solution for integration with Dynamics NAV.
First of all, please register the DLL with DOS command
regsvr32 cruflbcs.dll
If you are using 64-bit Windows 7 or Windows Vista, please open DOS prompt as administrator.
%systemroot%\System32\regsvr32 cruflbcs_x64.dll
If you are unable to create automation object on a Dynamics Nav server, please use the following solution
create(name-of-object, false, true)
1. Define some Global variables as shown below:
Name |
Data Type |
Sybtype |
Length |
PDFCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
DataMatrixCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
QRCodeCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
AztecCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
MaxiCodes |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
GS1DatabarCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
LinearCode |
Automation 'cruflBCS 4.0 Type Library'.CPDF417 |
|
|
_PDF |
Text |
|
1024 |
_DataMatrix |
Text |
|
1024 |
_Qrcode |
Text |
|
1024 |
_AZTEC |
Text |
|
1024 |
_MAXICODE |
Text |
|
1024 |
_GS1Databar |
Text |
|
1024 |
_LINEAR |
Text |
|
1024 |
_text |
Text |
|
1024 |
2. For PDF417 Barcode in Dynamics NAV
Don't forget to use font typeface BcsPdf417 to returned string.
Code
IF ISCLEAR(PDFCode) THEN BEGIN
CREATE(PDFCode);
END;
_text := ‘pdf417 to encode‘;
_PDF := PDFCode.Encode(_text);
Section:
element TextBox with properties
HorzAlign General
FontName BcsPDF417
MultiLine Yes
SourceExpr _PDF
3. For Data Matrix Barcode in Dynamics NAV
Don't forget to use font typeface BcsDatamatrix to returned string.
Code
IF ISCLEAR(QrcodeCode) THEN BEGIN
CREATE(QrcodeCode);
END;
_text := ‘qrcode to encode‘;
_Qrcode := QrcodeCode.Encode(_text);
Section:
element TextBox with properties
HorzAlign General
FontName BcsQrcode
MultiLine Yes
SourceExpr _Qrcode
4. For MaxiCode Barcode in Dynamics NAV
Don't forget to use font typeface Bcsmaxicode to returned string.
Code
IF ISCLEAR(MaxiCodes) THEN BEGIN
CREATE(MaxiCodes);
END;
_text := 'maxicode to encode';
_MaxiCodes:= MaxiCodes.EncodeCR(_text, 0, 3); //Please notice that 3 is mode.
Section:
element TextBox with properties
HorzAlign General
FontName Bcsmaxicode
MultiLine Yes
SourceExpr _Maxicodes
5. For GS1-Databar Barcode in Dynamics NAV
Don't forget to use font typeface Bcsdatabarm to returned string.
Code
IF ISCLEAR(GS1DatabarCode) THEN BEGIN
CREATE(GS1DatabarCode);
END;
_text := 'databar to encode';
_GS1Databar:= GS1DatabarCode.Databar14(_text);
Section:
element TextBox with properties
HorzAlign General
FontName Bcsdatabarm
MultiLine No
SourceExpr _GS1Databar
6. For Code128 Barcode in Dynamics NAV
Don't forget to use font typeface Code128aMHr to returned string.
Code
IF ISCLEAR(LinearCode) THEN BEGIN
CREATE(LinearCode);
END;
_text := ‘Text to encode‘;
_LINEAR := LinearCode.Code128A(_text);
Section:
element TextBox with properties
HorzAlign General
FontName Code128AmHr
MultiLine No
SourceExpr _LINEAR
7. For GS1-128 Barcode in Dynamics NAV
Don't forget to use font typeface Code128m to returned string.
Code
IF ISCLEAR(LinearCode) THEN BEGIN
CREATE(LinearCode);
END;
_text := ‘Text to encode‘;
_LINEAR := LinearCode.UCCEAN128(_text);
Section:
element TextBox with properties
HorzAlign General
FontName Code128m
MultiLine No
SourceExpr _LINEAR
8. For Intelligent Mail Barcode in Dynamics NAV
Don't forget to use font typeface BcsIM to returned string.
Code
IF ISCLEAR(LinearCode) THEN BEGIN
CREATE(LinearCode);
END;
_text := ‘Intelligent Mail barcode to encode‘;
_LINEAR := LinearCode.IM(_text);
Section:
element TextBox with properties
HorzAlign General
FontName BcsIM
MultiLine No
SourceExpr _LINEAR
You can generate all linear and 2D barcodes in Dynamics NAV.
Here is a list of all supported bar code symbologies and suggested bar code fonts.