Page 1 of 1

[Unit][ReportWorkshop] Display fields as QRCode

Posted: Sun Sep 17, 2023 2:51 pm
by Sergey Tkachenko
This example shows how to display values of fields in ReportWorkshop as QRCodes.

This is the first version of barcode field object for ReportWorkshop. It supports only QRCodes, and generates results as TMetafile (so it is VCL-only)

How to use
  1. Download Zint Barcode Generator for Delphi, free open source barcode generator for Delphi and Lazarus. Add path to its PAS-files to Delphi library.
  2. Include RVReportZintBarcode.pas in your project.
  3. Add RVReportZintBarcode.pas to "uses" of the main form unit.
Syntax

This unit implements "qrcode" field type to display text values as QRCodes.
The simplest syntax:

Code: Select all

{FIELDNAME qrcode}
This field type has an optional format string, in a form of space-delimited list property=value, with supported properties:
  • size - image size in pixels (default - 100)
  • color - foreground color (default - black)
  • backcolor - background color (default - white)
Example:

Code: Select all

{VALUE qrcode "color=darkred size=200"}
Example

Report design

RW-QRCode-Design.png
RW-QRCode-Design.png (28.75 KiB) Viewed 31063 times

Report result:

RW-QRCode-Result.png
RW-QRCode-Result.png (26.08 KiB) Viewed 31063 times

Plans

I plan to extend this unit:
  • to allow generation of all types of barcodes supported by Zint
  • to support more output image formats
  • Lazarus compatibility
  • more parameters in format string

Re: [Unit][ReportWorkshop] Display fields as QRCode

Posted: Tue Sep 26, 2023 8:58 am
by Sergey Tkachenko
Update: a download link is removed, because an advanced version of this add-on is included in ReportWorkshop setup, in <TRichView Dir>\ThirdParty\Barcode\Zint\Source\ folder.
It implements all the features listed in the "plans" above.