MS Visual Studio How to set up the LOGMARS barcode in FastReport .NET

Microsoft Vistual Studio

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
How to set up the LOGMARS barcode in FastReport .NET
September 6, 2021 by Vladislav Yarovoy

LOGMARS stands for Logistics Applications of Automated Marking and Reading Symbols. It is a specification used by the U.S. government for the military goods supply.
LOGMARS is a standard based on the Code 39 barcode. Code 39 consists of self-checking barcode symbols that usually do not require a check digit. However, in applications that require high accuracy, a check digit modulo 43 is added after the data. Since LOGMARS is used by the military, the check digit is mandatory. This barcode is defined by the military standard Для просмотра ссылки Войди или Зарегистрируйся, which contains not only the information about where the barcode should be placed on the military cargo, but also what kind of data and how long it should be in accordance with military specifications.

Alike Code 39, LOGMARS can encode uppercase Latin letters, all numbers, and special characters (such as *, -, $, %, (space), ., /, and +).

Please note that in FastReport .NET the Code 39 barcode always contains check digits and has no data length limit. This means that it can be used as a full implementation of LOGMARS.

Adding a barcode from the designer​

1631087756214.png
You do not need to look for LOGMARS in the designer.

Select Code 39 and add it to the report page. All properties of this barcode were described in the article “Для просмотра ссылки Войди или Зарегистрируйся

Enter the value “DAHC9488O0007” into the barcode editor and save.

Creating a Code 39 barcode using the code​

Код:
//Create a new report object
Report report = new Report();
//Create a report page
ReportPage page = new ReportPage();
//Create a unique identifier
page.CreateUniqueName();
//Add it to the collection of report pages
report.Pages.Add(page);
//Create a new DataBand
DataBand dataBand = new DataBand();
//with a unique identifier
dataBand.CreateUniqueName();
//and add it to the band collection
page.Bands.Add(dataBand);
//Create a barcode object
FastReport.Barcode.BarcodeObject barcode = new FastReport.Barcode.BarcodeObject();
 //Set a barcode type
 barcode.Barcode = new FastReport.Barcode.Barcode39();
//Set the numeric combination for encoding
barcode.Text = "DAHC9488O0007";
//Place the barcode on the page
 barcode.Parent = dataBand;
 //Set the size of the object
barcode.Bounds = new RectangleF(0, 0, Units.Centimeters * 10, Units.Centimeters * 3);
//Show the report
report.Show();
As a result, we will get the following barcode:
1631087806329.png
Now you know a little more about the LOGMARS barcode as a part of the military specification. With FastReport .NET you can create this standard by configuring Code 39 barcode.