QRCode Control Type


The UX Component's QRCode control displays its value as a QR Code.

The QRCode control is a client-side control. That means that Javascript is used to generate the QR code. You can also use Xbasic methods to generate servers-side QR codes (as bitmaps or SVG). See ::QRCode::Creator:: below for more details.

To place a QRCode control on a UX, select the control type from the toolbox.

The QRCode control is just like other data bound controls in that it has a .getValue() and .setValue() method. To display a QR code, you simply call the .setValue() method of the control. For example:

{dialog.object}.setValue('MYQRCONTROL_1','value to encode');

 QRCodes - Xbasic

New methods have been added to Xbasic to generate QRCodes. The methods are:

The flags parameter can be set to 'L' (low), 'M' (medium), 'Q', or 'H' (high) to indicate the level of error correction in the generated QR Code.

For example, from the Interactive window:

dim svg as c 
svg = ::QRCode::Creator::GenerateSVG("http://www.alphasoftware.com","L")

To display a QR code in an Xdialog:

svg = ::QRCode::Creator::GeneratePngFile("http://www.alphasoftware.com","c:\myfiles\qr1.png","L")

 QRCodes - Layout Table Reports

Layout Table Reports now support printing any cell in the Layout Table that contains a text value as a QR code.

To print the contents of a cell as q QR code, simply check the 'Display QRCode for text in cell' property at the bottom of the 'Cell Contents' dialog box.

For example, here is a report showing customers in the sample Northwind database:

See Also