IDAutomation.com, Inc. IDAutomation.com, Inc.
TLV Base64

TLV Base64 QR Code in Crystal Reports

Encode TLV and Base64 data for e-invoice QR Codes with the Native Crystal Reports Generator.

The Crystal UFL is considered legacy. Use the Font Formulas when using a font, or the Native Crystal Reports Generator.

Pipe-separated fields in, QR Code out

Pass the invoice fields as a |-separated string. The formula calculates the byte lengths, builds the TLV structure and converts it to Base64 natively.

  • TLV in Base64: the first character is |
  • TLV without Base64: the first two characters are ^|
  • Base64: the first character is =, and the rest of DataToEncode is encoded
  • Requires ProcessTilde = 1
TLV Base64 QR Code flow: pipe-separated invoice fields become tag-length-value data, are Base64 encoded and placed in a QR Code for e-invoicing

Data formats

The three input modes from the Native Crystal Reports Generator QR Code page. Verify results with the Data Decoder Verifier App (opens in a new tab).

' TLV in Base64
DataToEncode = "|IDAutomation|123456789012345|2022-11-30 06:04:31|92435.77|2692.77"
' TLV without Base64
DataToEncode = "^|IDAutomation|123456789012345|2022-11-30 06:04:31|92435.77|2692.77"
ProcessTilde = 1

Frequently asked questions

What is TLV Base64 in a QR Code?

A method of encoding invoice fields as Tag-Length-Value (TLV) data, encoding that string in Base64, and placing the result in a QR Code. Saudi Arabia's ZATCA requires this for e-invoicing.

How do I choose the mode?

With ProcessTilde = 1, a leading | encodes the separated values as TLV in Base64, a leading ^| encodes TLV without Base64, and a leading = Base64-encodes the rest of DataToEncode.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It also lets scanners that cannot handle some Unicode characters, such as Arabic text, read the data.

Which version supports it?

IDAutomation QR Code products from 2022 or later support TLV with or without Base64 when ApplyTilde or ProcessTilde is enabled.

Next: Swiss QR Bill

Add the Swiss cross with Center Override.

SWISS QR BILL