|
|
|
|
|
- Overview
- Printing a bar code from a report
- Printing a bar code in WLanguage
WINDEV, WEBDEV and WINDEV Mobile allow you to print bar codes. You can use: - a "Bar code" control in a report.
- iPrintBarCode in a print performed in WLanguage.
Printing a bar code from a report The report editor proposes a "Bar code" control. The Bar Code control can be directly bound to an item in the data source of the report. Bar Code controls can be configured in the description window ("Description" option on the context menu). Different characteristics can be set according to the type of bar code: - strikethrough barcode: the last character of the barcode corresponds to a check digit.
- extended barcode: the barcode value can contain all 128 characters of the ASCII code.
- displaying (or not) the value of the bar code.
- management of formatting.
- management of control characters and management of character set.
Regardless of the type of bar code, you can also: - configure the size of the bar code.
- configure the characteristics of the border.
- manage the orientation of the bar code.
To print the bar code, assign the value of the bar code to the Bar Code control. Printing a bar code in WLanguage To print a bar code in WLanguage, you must use iPrintBarCode. iPrintBarCode proposes two syntaxes: - syntax used to print a bar code directly (this syntax does not support QR Codes):
iPrintBarCode(<Value>, <Type>, <Coordinates of rectangle>, <Characteristics>) The parameters are as follows:- the value of the bar code. This value can be printed below the bar code.
- the type of the bar code to print.
- the coordinates (in pixels) of the rectangle in which the bar code will be printed.
- the characteristics of the bar code (if necessary).
- syntax used to print a bar code in a variable of type BarCode (this syntax supports QR Codes):
iPrintBarCode(<BarCodes Variable>, <Coordinates of rectangle>) All the parameters of the bar code to print are specified in the BarCode variable.
Regardless of the syntax used: - The bar code is printed in an invisible rectangle. This rectangle is used to specify the position and size of the bar code to print.
- "EAN" and "UPC" bar codes have proportional width and height. To enlarge these bar codes, it is necessary to increase both height and width.
- iEndPrinting must be used to start the actual print. This function must be the last print function used.
The following example presents the click code of a button used to print a EAN 13 bar code. The value of the bar code is retrieved in the edit control named "EDT_EditBC". iPrintWord("EAN 13 bar code:")
iPrintBarCode(EDT_EditBC, BC_EAN13, 10, 10, 50, 100)
iEndPrinting()
The following example allows you to print a QR Code: MyQRCode is BarCode
MyQRCode.Content = "http://www.windev.com"
MyQRCode.ContentType = bcTypeText
MyQRCode.TypeBarCode = BC_QRCODE
iPrintBarCode(MyQRCode, 10, 20, 50, 60)
iEndPrinting()
Related Examples:
|
Unit examples (WINDEV): The Bar Code control
[ + ] Using a Bar Code control
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|