QR-Code in a Crystal Reports reportCrystal Reports QR-Code Barcode Generator (With Swiss QR, TLV, and Base64)

  • Supports standard QR-Code in addition to GS1-QRCode, AIM-QRCode, and Micro QR-Code.
  • Easily add QR-Code 2D symbols to Crystal Reports without installing fonts.
  • Created according to the ISO/IEC 18004:2015 standard accepted worldwide.
  • The QR-Code object stays embedded in the report, even when it is distributed.
  • Implementation is easy; copy and paste the object into the report.
  • Supports Crystal 9 and up. 
  • Includes patented technology available only at IDAutomation.
  • Native source code is provided with the purchase.
  • Version 2020 and greater adds support for the Swiss QR-Bill as Center Override.
  • Version 2021 and greater supports UTF-8 encoding; this includes compatibility with Kanji, Arabic & Japanese characters.
  • Version 2022 supports TLV (Tag-Length-Value) in Base64 QR Code for ZATCA Saudi KSA E-Invoicing.
  • Version 2024 supports Auto Encoding Mode.

User Manual Swiss QR Bill TLV Base64 Download Demo Buy License

Developed by IDAutomation for Crystal Reports

QR Code is a matrix symbology similar to Data Matrix. The Native Crystal version encodes ASCII Characters, numbers, text, and actual bytes of data, including Unicode UTF-8 characters and images according to the ISO/IEC specification. Three modes are supported including binary, digits and uppercase letters, and large numbers. The latest version supports QR Code Invoicing, Swiss QR Code, QR Bill, TLV, and BASE64 encoding.

A single Crystal Reports RPT file provided in this package contains the formula object. Properties of the symbol generation may be easily changed in the first part of the file and shown in the code sample below. 

'Modify DataToEncode to connect to the data source;
'For example: 'DataToEncode = ({DataTable.DataField})

DataToEncode = "This QR-Code encoder is provided by IDAutomation.com"

' Optional parameters
ProcessTilde = 1            ' If = 1 the Tilde will be processed 
EncodingModes = 0           ' 0=Binary | 1=0nly numbers and uppercase letters | 2=Numbers only
ErrorCorrectionLevels = 0   ' 0=15% | 1=30% | 2=7% | 3-25% 
Version = 0                 ' 0=Automatic 
UTF8 = 1                    ' 1 enables UTF-8 Unicode encoding. If not needed, set the UTF8 variable to 0 to speed up processing
NewLineCharacter = Chr(13) & Chr(10)

To verify the proper encoding of GS1 Data, ASCII functions, and UTF8 Unicode, IDAutomation recommends the Barcode Decoder Verification App.

TLV Base64 QR Code Example

Version 2022 and greater of this product supports an easy method of encoding TLV (Tag-Length-Value) in Base64 for QR Code compatible with ZATCA, Saudi, Zakat & KSA E-Invoicing. It also contains a general Base64 encoding option that may be easily decoded with the IDAutomation Data Decoder App. This functionality is enabled when ProcessTilde = 1.

  • TLV in Base64 - When the first character is | the Crystal Formula automatically encodes TLV values separated by | in Base64, for example:
    DataToEncode = "|IDAutomation|123456789012345|2022-11-30 06:04:31|92435.77|2692.77"
  • TLV without Base64 - When the first two characters are ^| then automatically encode TLV values separated by | for example:
    DataToEncode = "^|IDAutomation|123456789012345|2022-11-30 06:04:31|92435.77|2692.77"
  • Base64 - When the first character is = encode the DataToEncode in Base64 excluding the =

Video Tutorial Encoding TLV Base64 QR Code in Crystal Reports

Video Encoding a Tab Function and Multiple Fields in QR Code Crystal Reports

Swiss QR Bill Center Override Example

Version 2020 and greater of this product supports an easy method of encoding the Swiss cross into the center of the symbol with Center Override which is a form of image overlay. The QR Bill specifications require a 46x46mm symbol with a 7x7mm cross in the center. To obtain these sizes in the Native Crystal Reports Generator with a standard amount of data, the following settings are required:

  1. Change the font of the object to Consolas at 2.5 points and a line spacing of 0.9 times normal.
  2. Change the error correction level to "0" which is "M".
  3. Change the version to 23.
  4. Use the 17x17 QR Bill Swiss Cross String.
  5. It is recommended to change the zoom to 300% or 400% to check the sizes with the ruler within Crystal. Some white lines or distortion may appear because of low screen resolution, however, the symbol should be accurate when printed.
  6. If more data needs to be encoded, change the version to 25 and lower the point size of the object to 2 points.

When formatting the data for the QR Bill, the LF command is inserted with the &Chr(10)& code, and static data must be in quotes. Below is an example that generates the Swiss QR as static data in a report.

Dim Swiss_QR_Data as String
Swiss_QR_Data = "SPC"&Chr(10)&"0200"&Chr(10)&"1"&Chr(10)&"CH7122334455667788991"&Chr(10)&"S"&Chr(10)&"IDAutomation.com Inc."&Chr(10)&"Tampa Bay"&Chr(10)&"45"&Chr(10)&"5050"&Chr(10)&"Florida"&Chr(10)&"CH"&Chr(10)&""&Chr(10)&""&Chr(10)&""&Chr(10)&""&Chr(10)&""&Chr(10)&""&Chr(10)&""&Chr(10)&"0.00"&Chr(10)&"CHF"&Chr(10)&"S"&Chr(10)&"IDAutomation.com"&Chr(10)&"Mühlfeldstraße"&Chr(10)&"4"&Chr(10)&"3441"&Chr(10)&"Einsiedl"&Chr(10)&"AT"&Chr(10)&"SCOR"&Chr(10)&"3100000007739471430109015"&Chr(10)&"This Swiss QR Code was generated by IDAutomation.com"&Chr(10)&"EPD"&Chr(10)
'Add the 17x17 Swiss Cross in the center
DataToEncode = Swiss_QR_Data & "~COHH,0000007FFF007E3F007E3F007E3F007E3F007E3F004001004001004001007E3F007E3F007E3F007E3F007E3F007FFF00000000"
' Optional parameters;
ProcessTilde = 1                   
EncodingModes = 0                      
ErrorCorrectionLevels = 0              
Version = 23                           
NewLineCharacter = Chr(13) & Chr(10)
UTF8 = 1   
The symbol generated from the code above:
Crystal Reports QR Code With Swiss QR, TLV and Base64

If more options are needed for sizing, download and install the IDAutomation 2D S font, change the font of the object to "IDAutomation 2D S" and use the point size of 4.5. 

About the Legacy Hybrid Version

A hybrid version of the QR Code Generator is included for high-speed barcode generation, which requires the installation of the IDAutomation Crystal UFL (version 2015 or later) to perform a portion of complex calculations required for quicker barcode generation. Installation of this UFL is automatic when running the installer for this product. It is highly recommended to use the native formula object instead of the UFL. The UFL does not support the latest capabilities including UTF-8, TLV, Base64, GS1-QRCode, and Micro QR-Code.