尝试在 JasperReports 中打印二维码时出现以下错误
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(new com.google.zxing.qrcode.QRCodeWriter().encode("((java.lang.String)field_RECSEQ.getValue())",com.google.zxing.BarcodeFormat.QR_CODE,300 ,150 )); //$JR_EXPR_ID=10$
最佳答案
我通过将 core.jar (com.google.zxing:core) 和 javase.jar (com.google.zxing:javase) 添加到构建路径。
关于java - 在 JasperReports 5.6.1 中打印二维码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25853682/