|
- 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 linked to an item found in the data source of the report. The configuration of a "Bar code" control is performed in its description window ("Description" option of its popup menu). Different characteristics can be managed according to the type of the bar code: - bar codes with check: the last character of the bar code corresponds to a control character.
- extended bar code: the value of the bar code can contain the 128 characters found in 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 the type of bar code, you also have the ability to: - 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, all you have to do is assign the Bar Code control with its value. Versions 16 and later New in version 16 Versions 16 and later New in version 16Printing 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 the QR Code bar 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).
Versions 16 and latersyntax used to print a bar code found in a BarCode variable (this syntax supports the QR Code bar codes):
iPrintBarCode(<BarCodes Variable>, <Coordinates of Rectangle>)
All the parameters of the bar code to print are specified in the BarCode variable. New in version 16syntax used to print a bar code found in a BarCode variable (this syntax supports the QR Code bar codes):
iPrintBarCode(<BarCodes Variable>, <Coordinates of Rectangle>)
All the parameters of the bar code to print are specified in the BarCode variable. syntax used to print a bar code found in a BarCode variable (this syntax supports the QR Code bar 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.
- For the "EAN" and "UPC" bar codes, the height of the bar code is proportional to its width. To increase the size of these bar codes, both the height and width must be increased.
- 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()
Versions 16 and laterThe following example is used to print a QR Code bar code:
MyQRCode is BarCodes MyQRCode..Content = "http://www.WINDEV.com" MyQRCode..ContentType = bcTypeText MyQRCode..TypeBarCode = BC_QRCODE iPrintBarCode(MyQRCode, 10, 20, 50, 60) iEndPrinting()
New in version 16The following example is used to print a QR Code bar code:
MyQRCode is BarCodes MyQRCode..Content = "http://www.WINDEV.com" MyQRCode..ContentType = bcTypeText MyQRCode..TypeBarCode = BC_QRCODE iPrintBarCode(MyQRCode, 10, 20, 50, 60) iEndPrinting()
The following example is used to print a QR Code bar code:
MyQRCode is BarCodes 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
|
|
Training (WINDEV): WD Reports
[ + ] This example presents the different methods for creating a report: - prints based on different data sources (queries, variables, ...) - prints based on controls (Table, Spreadsheet, PVT, ...) - printing composite reports - specific prints (portrait/landscape, report with watermark, report with bar code, ...)
|
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |