QR-Code in a Crystal Reports reportCrystal Reports QR-Code Barcode Generator (With Swiss QR, TLV, UTF8 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.
  • The latest version adds support for the Swiss QR-Bill as a Center OverrideUTF-8 encodingTLV (Tag-Length-Value) in Base64 QR Code for ZATCA Saudi KSA E-Invoicing, Micro QR Code, and Auto Encoding Mode.

User Manual Swiss QR Bill TLV Base64 Download Demo Buy License FAQ

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, 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 7x7 mm 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 or saved in a PDF.
  6. If more data needs to be encoded, change the version to 25 and lower the point size of the object to 2 points. 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. 

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



FAQ

  • How do you get QR codes working in Crystal Reports without messing with UFLs or external fonts?

    The Native Crystal Reports Generator handles the heavy lifting through a patented technology that runs entirely as a formula object inside the report file. Because the encoding algorithms are processed directly by Crystal's native formula engine, it completely sidesteps the need to install special barcode fonts or external User Function Libraries (UFLs) on client machines or web servers. You can check out the setup steps on the IDAutomation Native Barcode Generator for Crystal Reports page.

  • Can this native formula handle GS1-compliant QR codes out of the box?

    Yes, it features a built-in capability to easily encode GS1 data. By turning on the ProcessTilde option, you can format your application identifiers (AIs) directly within your data string. The formula automatically parses the data to ensure your codes meet the strict standards required by GS1. For examples on formatting these strings, look at the BarcodeFAQ QR Code 2D Tutorial.

  • Does the formula calculate MOD 10 and MOD 43 checksums, or do I have to code that manually?

    You don't need to write complex custom loops or math routines in Crystal Syntax to append your check digits. The tool has a built-in capability to easily calculate MOD 10 and MOD 43 checksums natively within the barcode data stream, saving you development time and preventing manual errors. See the parameter specs on the IDAutomation QR Code Native Generator product page.

  • How do I inject non-printable ASCII functions like tabs or returns into the QR code data?

    IDAutomation includes a built-in capability to easily encode ASCII functions such as RS, GS, EOT, and basic control characters. If you enable the ProcessTilde variable, you can use tilde commands directly in your string—like ~d009 to trigger a tab function or ~d013 to trigger a return function. The complete syntax list is available on the BarcodeFAQ QR Code Function Guide.

  • Does the native QR code generator support international text or multi-byte character sets?

    Yes, the formula object has the specific ability to automatically encode UTF-8 Unicode characters. You don't need external pre-processors or conversion scripts to handle Kanji, Cyrillic, or accented characters—the formula handles the byte-shifting natively so modern 2D scanners decode the text correctly. More details are on the IDAutomation QR Code for Crystal Reports integration portal.

  • Can this generator build TLV and Base64 strings for Middle East e-invoicing requirements?

    Yes, it features a built-in capability to easily encode Tag-Length-Value (TLV) data and automatically output it as an encrypted Base64 string. If you pass a string prefixed with a pipe character (|), the formula builds the hex array and converts it to Base64 natively. This is an easy way to comply with ZATCA e-invoicing mandates in Saudi Arabia without relying on heavy backend development. Read the integration steps at the BarcodeFAQ TLV Base64 QR Code Guide.

  • How do you generate the Swiss cross overlay in the center of a Swiss QR Bill inside Crystal?

    The formula has an exclusive, built-in capability for Center Override, which can generate the Swiss cross right in the middle of the QR Code symbol. Instead of trying to hack a graphic overlay that might break scanner readability, the formula leaves a precise, spec-compliant blank spot to anchor the cross for official Swiss Payment Standards bills. See how to configure the grid layout on the BarcodeFAQ Swiss QR-Bill Tutorial.

  • Why do my QR codes look distorted or fail to scan when printed on 203 dpi thermal printers?

    Low-resolution 203 dpi printers often suffer from grid alignment errors because standard font scaling doesn't map perfectly to the printer's physical dot pitch. IDAutomation solves this by offering the ability to better support 203 dpi thermal printers with the specialized IDAutomation2D S font. When you set this specific font to 4.5 points, it forces the modules to align perfectly with the thermal print head's hardware grid. Check out the sizing instructions on the IDAutomation QR Code Sizing Guide.

  • What's the practical difference between using an old UFL and this native formula method?

    Legacy UFL (User Function Library) methods require you to distribute and register a COM or .NET DLL on every single workstation or web server running the report. If a user updates their machine or you migrate servers, the report breaks. The Native Crystal Reports Generator uses patented technology as a pure formula object—meaning the code lives entirely inside the report file itself. It completely sidesteps deployment hell. Compare the implementation differences on the IDAutomation Native Barcode Components page.

  • Can I generate Micro QR codes if I'm short on layout space?

    Yes. If you have tight space constraints on a label, you can force a compact Micro QR code by passing a negative value (like -4) to the version parameter in the formula configuration. Check the parameter limits on the IDAutomation QR Code Product Page.

  • Which versions of Crystal Reports actually support this native generator?

    It works out of the box with SAP Crystal Reports version 9 and all later versions, including Crystal Reports 2020 and enterprise runtime environments. Because it relies on basic, universal formula logic, it doesn't break when you upgrade your reporting software.

  • Do end-users need local administrator rights to view or print the QR codes?

    No. Because the barcode generation happens entirely through native report formulas, there are no client-side runtime installs, ActiveX controls, or browser plugins to manage. If a user has permission to view the report, they can see and print the QR code.

  • Does exporting the report to PDF ruin the QR code quality?

    No. When Crystal exports a report to PDF, it processes the formula-generated barcode text using vector mapping rather than turning it into a pixelated image. This means the resulting PDF maintains perfect resolution and crisp lines, no matter how much you zoom in.

  • How do I connect my actual database fields to the QR code?

    You just open up the Crystal Reports Formula Editor for the IDAutomation object and look for the DataToEncode variable assignment. Change it to point to your database field—for example, `DataToEncode = {Invoices.TrackingURL}`—or concatenate multiple fields together using standard Crystal syntax.

  • How much data can I actually cram into one of these QR codes?

    That depends on the mode and error correction level, but under the standard ISO/IEC 18004 specification, a standard Version 40 QR code caps out at 7,089 numeric characters or 4,296 alphanumeric characters. Keep in mind that more data means a denser, larger symbol, which requires a larger print area or higher resolution scanner.

  • How do I change the error correction level to make the code more damage-resistant?

    Look for the ErrorLevel variable inside the formula text. You can set it to L, M, Q, or H. Setting it to 'H' (High) provides up to 30% data recovery if the barcode gets scratched or dirty on a warehouse floor, though it will make the overall symbol size larger to accommodate the extra parity bytes.

  • Why does the QR code look blocky or weird inside the Crystal design view?

    Crystal's design view sometimes struggles to render dense text formulas cleanly at 100% zoom. To check your layout accurately, kick the zoom level up to 300% or 400% inside the designer. This gives you a true look at the module boundaries before you push the report to production.

  • Will running this formula on a 10,000-page batch report kill my processing performance?

    If you're dealing with massive print runs, you can optimize processing speeds by setting the UTF8 parameter to 0 (disabled), assuming your data is strictly standard ASCII text. This skips the heavier multi-byte Unicode parsing loop and accelerates document compilation times significantly.

About the Legacy Hybrid Version (not recommended)

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 the 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.