| Auszug |
|---|
|
Nuclos Jasper QR code: ZXing, QRCodeWriter, core.jar, javase.jar, image expression, classpath, barcode. |
Language: Deutsch · English
QR code
Generate QR codes in reports – ZXing library, QRCode class, classpath and free customization of the image expression.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
QR code in JasperReports
A QR code is a 2D matrix with error correction (up to ~30% loss). In Nuclos forms it is generated via the ZXing library and a small helper class.
1. ZXing library
Google provides ZXing. Copy core.jar (folder Core) and javase.jar (folder Javase) into the project folder.
2. QRCode class
| Codeblock |
|---|
|
package com.qrcodeself;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
/**
*
* @author
*/
public class QRCodeClass{
public static java.awt.Image setQRCode(String code) {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix matrix = null;
try {
matrix = writer.encode(code, BarcodeFormat.QR_CODE, 100, 100);
}catch (WriterException e){
}
return MatrixToImageWriter.toBufferedImage(matrix);
}
} |
3. Register in Nuclos
Provide the class as a scriptlet/extension and register it in the Jasper classpath parameter.
Customizing the QR code
Every base form contains a default QR code from the BO's abbreviation and number. The call is in the Image Expression property and can be composed freely (string concatenation with +):
| Codeblock |
|---|
|
"LS: " + $F{strnummer} |
| Info |
|---|
|
String fields are recognizable by the str prefix. Convert other types (dbl, int, bln, BigDecimal) first, e.g. $F{dblvknetto}.toString() or formatted new java.text.DecimalFormat("#,##0.00").format($F{dblvknetto}). |

Extended QR code values.
Related pages
Jasper extensions in Nuclos
Classpath.
Open →