Jasper Reports - Generating PDF 417 barcodes using Barcode4j
-
10-07-2019 - |
Question
We are currently using Jasper Reports to generate PDF 417 barcodes using Barcode4j.
We are using Barcode component for the same. If we set CodeExpression property to "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345" it throws following runtime exception.
Error filling print... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345"
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345"
at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluateExpression(BarcodeEvaluator.java:72) at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluateBaseBarcode(BarcodeEvaluator.java:53) at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluatePDF417(BarcodeEvaluator.java:145) at net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.visitPDF417(AbstractBarcodeEvaluator.java:424)
If we remove $ character from above code expression value it works fine. Has anyone got idea how to generate PDF417 barcodes having $ characted in Message using Jasper reports/Barcode 4J. Thanks
Solution
We are able to generate barcode in png format by directly using Barcode4J API. It seems that there is a bug in jasper reports which does not allow $ character in barcode messgae while generating PDF 417 barcode.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow