logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to generate QR code in FastReport VCL with Delphi/Lazarus code
  • How to create CODE 39 and CODE 39 Extended barcodes

    October 23, 2020

    CODE 39 is the barcode developed by Intermec Corporation in 1975. Up to 43 characters

    read more
  • How to generate ITF (interleaved, industrial, matrix) barcode with Delphi / Lazarus / C ++ Builder

    November 11, 2020

    A bit of theory about barcodes It is difficult to imagine our life without barcodes, especially

    read more
  • How to make a Swiss QR code bill in Delphi or Lazarus

    June 2, 2020

    Lately many countries have been digitizing payment processes. In other words, they convert existing payments

    read more
  • How to add an EPC QR code to an invoice from Delphi and Lazarus

    March 29, 2022

    The standardization of payment systems results not only in new standards but also in new

    read more
  • How to create an interactive PDF form for HR interviews in Delphi and Lazarus

    December 14, 2020

    Someone might not know, but the PDF standard allows you to create fillable forms. That

    read more

How to generate QR code in FastReport VCL with Delphi/Lazarus code

August 24, 2022

How to generate QR code in FastReport VCL with Delphi/Lazarus code

In recent years, QR codes have become an everyday part of our lives. They are a two-dimensional barcodes that can be easily read by a digital device and that store information as a series of pixels. They have become widely used in trade, logistics, and production.

Unlike a simple barcode, a QR code is read horizontally and vertically. Thus, they store more data. The ease of recognition and ease of use of QR codes predetermined their popularity. With FastReport VCL you can easily use QR codes in your reports. Let's look аt this possibility more closely.

Launch the report generator designer. Select the "QRCode" component from the pop-up menu of the "Barcode object" tool.

Selecting the “QRCode” component

 

When added to a page, the QRCode will look like this:

QR-Code in the report

 

Double click on it to open the 2D barcode editor. This can also be done from the context menu by selecting the "Edit" item:

Barcode editing

 

This is what the barcode editor looks like:

2D barcode editor

 

Let's look аt its main functions in detail:

1. In the “General” tab, you can change the size of the barcode, add a signature or rotate it.

2. On the “Other options” tab:

  • If CodePage <> 0 - ECI mode is used;
  • You can select the text encoding in the Encoding property;
  • The ErrorLevels property ensures redundancy for proper reading of data with a partially corrupted code image;
  • QuietZone detects if the QR code has a white frame.

3. In the expression editor, on the “Code” line, you can:

  • Access data source fields;
  • Use system variables;
  • Use various functions

In the “ExpressionPreset” object property, you can select presets for generаting receipts according to the specification of the Swiss code:

Selecting presets for the QR code

 

You can generate your own QR codes of various types, for this you need to specify a string of a certain format and set it in the Text property.

Let's take a closer look at these types with examples of barcodes and data:

URI is a Uniform Resource Identifier. It is a string to identify various files, documents, images, email, web service, etc.:

https://www.fast-report.com/en/

https://www.fast-report.com/en/

 

EmailAddress – E-mail address:

support@fast-report.com

support@fast-report.com 

EmailMessage – email text:

MATMSG:TO:support@fast-report.com;SUB:FastReport VCL question;BODY:Hello, I have a question about FastReport VCL.;

MATMSG:TO:support@fast-report.com;SUB:FastReport VCL question;BODY:Hello, I have a question about FastReport VCL.;

 

Geolocation – coordinates for  the real geographic location:

geo:-50.737563,-79.490016,120

geo:-50.737563,-79.490016,120

 

SMS – text message:

SMSTO:(71) 555-4444:Hello, Dolly! I'm fine!

 SMSTO:(71) 555-4444:Hello, Dolly! I'm fine!

 

Call – telephone number:

tel:(71) 555-4444

tel:(71) 555-4444

 

Wi -fi – information for connecting to wi-fi:

WIFI:T:WPA;S:Honeypot;P:youarewelcome;H:true;

WIFI:T:WPA;S:Honeypot;P:youarewelcome;H:true;

 

Let’s create а QR code from Delphi/Lazarus code:

uses frxBarcode2D;
procedure TForm1.Button1Click(Sender: TObject);
var
 bcQR: TfrxBarcode2DView;
begin
 bcQR := TfrxBarcode2DView(frxReport1.FindObject('Barcode2D1'));
 { Set the barcode type }
 bcQR.BarType := bcCodeQR;
 
 { Depending on the type you want to use, you need to }
 { leave one line that assigns the text of a certain format }
 
 { If you want to set url type: }
 bcQR.Text := 'https://www.fast-report.com/en/';
 
 { If you want to set EmailAddress type: }
 bcQR.Text := 'support@fast-report.com';
 
 { If you want to set EmailMessage type: }
 bcQR.Text :=
 'MATMSG:TO:support@fast-report.com;SUB:FastReport VCL question;BODY:Hello, I have a question about FastReport VCL.;';
 
 { If you want to set Geolocation type: }
 bcQR.Text := 'geo:-50.737563,-79.490016,120';
 
 { If you want to set SMS type: }
 bcQR.Text := 'SMSTO:(71) 555-4444:Hello, Dolly! I'' m fine ! ';
 
 { If you want to set Call type: }
 bcQR.Text := 'tel:(71) 555-4444';
 
 { If you want to set Wi-Fi type: }
 bcQR.Text := 'WIFI:T:WPA;S:Honeypot;P:youarewelcome;H:true;';
 frxReport1.ShowReport();
end;

 

We have looked аt how to use QR codes in FastReport VCL. This component brings more possibilities for using this report generator in modern workflow.

about product buy
avatar
German Bagaevski
QA
Fast Reports Team: German Bagaevski - Quality Assurance at Fast Reports
VCL Lazarus FastReport Barcode Designer Delphi QR Code

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy