PC SOFT

WINDEV的在线文档

  • Overview
  • Printing a bar code from a report
  • Printing a bar code in WLanguage
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
WinDev, WebDev and WinDev Mobile allow you to print bar codes. You have the ability to use:
  • a "Bar code" control in a report.
  • 打印条形码 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.

16版本和更高版本
WinDev Special case: QR Code bar code: the types proposed by default
In a report, you have the ability to print a QR Code bar code. Then, this QR will be decoded by an application that will propose a specific action according to the type of the QR Code.

The assignment mode of the Bar Code control depends on its type.

By default, the description window of the control in the report editor proposes 4 simple types:

  • a Text QR Code: This type of QR Code is used to associate a text with the bar code. To initialize this type of QR Code, all you have to do is assign it with a character string. For example:
    BCOD_QRCode"I am a simple text"
  • a Web Link QR Code: This type of QR Code is used to directly open a site. To initialize this type of QR Code, all you have to do is assign it with a site address. For example:
    BCOD_QRCode"http://www.windev.com"
  • a Phone Number QR Code: This type of QR Code is used to directly call a phone number. To initialize this type of QR Code, all you have to do is assign it with a phone number. For example:
    BCOD_QRCode"010203040506"
  • an Email Address QR Code: This type of QR Code is used to get the email address of a contact. To initialize this type of QR Code, all you have to do is assign it with an email address. For example:
    BCOD_QRCode"doc@pcsoft.fr"
16新版本
WinDev Special case: QR Code bar code: the types proposed by default
In a report, you have the ability to print a QR Code bar code. Then, this QR will be decoded by an application that will propose a specific action according to the type of the QR Code.

The assignment mode of the Bar Code control depends on its type.

By default, the description window of the control in the report editor proposes 4 simple types:

  • a Text QR Code: This type of QR Code is used to associate a text with the bar code. To initialize this type of QR Code, all you have to do is assign it with a character string. For example:
    BCOD_QRCode"I am a simple text"
  • a Web Link QR Code: This type of QR Code is used to directly open a site. To initialize this type of QR Code, all you have to do is assign it with a site address. For example:
    BCOD_QRCode"http://www.windev.com"
  • a Phone Number QR Code: This type of QR Code is used to directly call a phone number. To initialize this type of QR Code, all you have to do is assign it with a phone number. For example:
    BCOD_QRCode"010203040506"
  • an Email Address QR Code: This type of QR Code is used to get the email address of a contact. To initialize this type of QR Code, all you have to do is assign it with an email address. For example:
    BCOD_QRCode"doc@pcsoft.fr"
WinDev Special case: QR Code bar code: the types proposed by default
In a report, you have the ability to print a QR Code bar code. Then, this QR will be decoded by an application that will propose a specific action according to the type of the QR Code.

The assignment mode of the Bar Code control depends on its type.

By default, the description window of the control in the report editor proposes 4 simple types:

  • a Text QR Code: This type of QR Code is used to associate a text with the bar code. To initialize this type of QR Code, all you have to do is assign it with a character string. For example:
    BCOD_QRCode"I am a simple text"
  • a Web Link QR Code: This type of QR Code is used to directly open a site. To initialize this type of QR Code, all you have to do is assign it with a site address. For example:
    BCOD_QRCode"http://www.windev.com"
  • a Phone Number QR Code: This type of QR Code is used to directly call a phone number. To initialize this type of QR Code, all you have to do is assign it with a phone number. For example:
    BCOD_QRCode"010203040506"
  • an Email Address QR Code: This type of QR Code is used to get the email address of a contact. To initialize this type of QR Code, all you have to do is assign it with an email address. For example:
    BCOD_QRCode"doc@pcsoft.fr"

16版本和更高版本
WinDev Special case: QR Code bar code: the specific types
You also have the ability to print specific QR Code bar codes (SMS, contact, geographical position, ...). In this case, the assignment of the Bar Code control must be performed via the 条形码型 type.

You must:

  1. Define a 条形码型 variable:
    MyBarCode条形码型
  2. In the 条形码型 variable, specify the type of the QR Code bar code (for example, for an SMS bar code):
    MyBarCode..条形码类型=条形码.QRCODE
    MyBarCode..内容类型=条形码.短信类型
  3. Depending on the type of bar code, fill the corresponding element (see table below):
    Type of contentType of value (..内容)Note
    条形码.文本类型Character stringExample: "WinDev is great!"
    条形码.电话类型Character stringExample: "0612345678"
    条形码.短信类型Character string in the following format:
    <Number> + CR + <Message>

    If they are specified, the members of the SMS structure (短信.消息 and 短信.号码) will be automatically taken into account.

    Example: "0612345678<CR>Text to send"
    条形码.URL型Character stringExample: "http://www.google.com"
    条形码.电子邮件类型Character stringExample: "name@email.com"
    条形码.联系人类型Empty. The members of the mContact structure will be automatically taken into account.
    条形码.位置类型地理位置型 variable.

    The ..纬度 and ..经度 properties of the variable will be automatically taken into account.

16新版本
WinDev Special case: QR Code bar code: the specific types
You also have the ability to print specific QR Code bar codes (SMS, contact, geographical position, ...). In this case, the assignment of the Bar Code control must be performed via the 条形码型 type.

You must:

  1. Define a 条形码型 variable:
    MyBarCode条形码型
  2. In the 条形码型 variable, specify the type of the QR Code bar code (for example, for an SMS bar code):
    MyBarCode..条形码类型=条形码.QRCODE
    MyBarCode..内容类型=条形码.短信类型
  3. Depending on the type of bar code, fill the corresponding element (see table below):
    Type of contentType of value (..内容)Note
    条形码.文本类型Character stringExample: "WinDev is great!"
    条形码.电话类型Character stringExample: "0612345678"
    条形码.短信类型Character string in the following format:
    <Number> + CR + <Message>

    If they are specified, the members of the SMS structure (短信.消息 and 短信.号码) will be automatically taken into account.

    Example: "0612345678<CR>Text to send"
    条形码.URL型Character stringExample: "http://www.google.com"
    条形码.电子邮件类型Character stringExample: "name@email.com"
    条形码.联系人类型Empty. The members of the mContact structure will be automatically taken into account.
    条形码.位置类型地理位置型 variable.

    The ..纬度 and ..经度 properties of the variable will be automatically taken into account.

WinDev Special case: QR Code bar code: the specific types
You also have the ability to print specific QR Code bar codes (SMS, contact, geographical position, ...). In this case, the assignment of the Bar Code control must be performed via the 条形码型 type.

You must:

  1. Define a 条形码型 variable:
    MyBarCode条形码型
  2. In the 条形码型 variable, specify the type of the QR Code bar code (for example, for an SMS bar code):
    MyBarCode..条形码类型=条形码.QRCODE
    MyBarCode..内容类型=条形码.短信类型
  3. Depending on the type of bar code, fill the corresponding element (see table below):
    Type of contentType of value (..内容)Note
    条形码.文本类型Character stringExample: "WinDev is great!"
    条形码.电话类型Character stringExample: "0612345678"
    条形码.短信类型Character string in the following format:
    <Number> + CR + <Message>

    If they are specified, the members of the SMS structure (短信.消息 and 短信.号码) will be automatically taken into account.

    Example: "0612345678<CR>Text to send"
    条形码.URL型Character stringExample: "http://www.google.com"
    条形码.电子邮件类型Character stringExample: "name@email.com"
    条形码.联系人类型Empty. The members of the mContact structure will be automatically taken into account.
    条形码.位置类型地理位置型 variable.

    The ..纬度 and ..经度 properties of the variable will be automatically taken into account.

Printing a bar code in WLanguage
To print a bar code in WLanguage, you must use 打印条形码.
打印条形码 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).
  • 16版本和更高版本
    syntax used to print a bar code found in a 条形码型 variable (this syntax supports the QR Code bar codes):
    iPrintBarCode(<条形码型 Variable>, <Coordinates of Rectangle>)

    All the parameters of the bar code to print are specified in the 条形码型 variable.
    16新版本
    syntax used to print a bar code found in a 条形码型 variable (this syntax supports the QR Code bar codes):
    iPrintBarCode(<条形码型 Variable>, <Coordinates of Rectangle>)

    All the parameters of the bar code to print are specified in the 条形码型 variable.
    syntax used to print a bar code found in a 条形码型 variable (this syntax supports the QR Code bar codes):
    iPrintBarCode(<条形码型 Variable>, <Coordinates of Rectangle>)

    All the parameters of the bar code to print are specified in the 条形码型 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.
  • 打印结束 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".

打印文字"EAN 13 bar code:"
打印条形码EDT_EditBC条形码.EAN13101050100
打印结束()

16版本和更高版本
The following example is used to print a QR Code bar code:

MyQRCode条形码型
MyQRCode..内容="http://www.windev.com"
MyQRCode..内容类型=条形码.URL型
MyQRCode..条形码类型=条形码.QRCODE
打印条形码MyQRCode10205060
打印结束()
16新版本
The following example is used to print a QR Code bar code:

MyQRCode条形码型
MyQRCode..内容="http://www.windev.com"
MyQRCode..内容类型=条形码.URL型
MyQRCode..条形码类型=条形码.QRCODE
打印条形码MyQRCode10205060
打印结束()
The following example is used to print a QR Code bar code:

MyQRCode条形码型
MyQRCode..内容="http://www.windev.com"
MyQRCode..内容类型=条形码.URL型
MyQRCode..条形码类型=条形码.QRCODE
打印条形码MyQRCode10205060
打印结束()