Nuclos QR code report: ZXing, QRCodeWriter, MatrixToImageWriter, image expression, java.awt.Image, GiroCode, extensions.

globe with meridians Language: Deutsch · English

hammer and wrench QR codes in reporting

QR codes in reports/forms – via ZXing and the image element, e.g. for GiroCode.

On this page

QR codes in reporting

QR codes can be used via the image element in JasperReports – and thus in Nuclos (e.g. for the GiroCode/EPC QR code).

Prerequisites

Procedure

Add the ZXing libraries in Jaspersoft Studio as external JARs via the project properties. Then insert an image element and set the QR generator in its image expression (field from the data source, here $F{ZEICHENKETTE}; width/height via encode(...)):

com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
  new com.google.zxing.qrcode.QRCodeWriter().encode(
    $F{ZEICHENKETTE},
    com.google.zxing.BarcodeFormat.QR_CODE, 300, 300))

Image expression with the QR generator.

Before uploading, set the expression class = java.awt.Image – otherwise the server aborts the upload with an error. To use it in Nuclos, transfer the libraries as extensions.

Example output of a QR code.

Related pages

printer Working with Jasper Studio


Overview.

Öffnen →

clipboard Embedding a barcode


Barcodes.

Öffnen →