添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
可爱的山羊  ·  gcc4.9.0 build error: ...·  4 周前    · 
耍酷的铁板烧  ·  [BUG] a.Readfile is ...·  1 月前    · 
大气的日光灯  ·  WPF 解决 ListView ...·  10 月前    · 

I've added a UPCA barcode which references a field in the JSON file.

converted-file.png.09d9e6b69f50a60a1a18e5b06e87b316.png

I've got the EAN13 option working, but if the barcode is 12 digits, I'm supposed to use the UPCA option. I've got a print when on each barcode.

I get this error:

Can anyone please help!?

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: Error creating barcode.    at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:553)    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:528)    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:446)    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)Caused by: net.sf.jasperreports.engine.JRRuntimeException: Error creating barcode.    at net.sf.jasperreports.components.barbecue.BarcodeProviders.createBarcode(BarcodeProviders.java:114)    at net.sf.jasperreports.components.barbecue.BarbecueFillComponent.setBarcodeImage(BarbecueFillComponent.java:142)    at net.sf.jasperreports.components.barbecue.BarbecueFillComponent.fill(BarbecueFillComponent.java:111)    at net.sf.jasperreports.engine.fill.JRFillComponentElement.fill(JRFillComponentElement.java:198)    at net.sf.jasperreports.engine.fill.JRFillElementContainer.fillElements(JRFillElementContainer.java:1040)    at net.sf.jasperreports.engine.fill.JRFillFrame.fill(JRFillFrame.java:354)    at net.sf.jasperreports.engine.fill.JRFillElementContainer.fillElements(JRFillElementContainer.java:1040)    at net.sf.jasperreports.engine.fill.JRFillFrame.fill(JRFillFrame.java:354)    at net.sf.jasperreports.engine.fill.JRFillElementContainer.fillElements(JRFillElementContainer.java:1040)    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:469)    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428)    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2615)    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:836)    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:275)    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:622)    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)    at java.base/java.lang.Thread.run(Unknown Source)Caused by: net.sourceforge.barbecue.BarcodeException: Invalid data length    at net.sourceforge.barbecue.linear.upc.UPCABarcode.<init>(Unknown Source)    at net.sourceforge.barbecue.linear.upc.UPCABarcode.<init>(Unknown Source)    at net.sourceforge.barbecue.BarcodeFactory.createUPCA(Unknown Source)    at net.sf.jasperreports.components.barbecue.BarcodeProviders$UPCAProvider.createBaseBarcode(BarcodeProviders.java:377)    at net.sf.jasperreports.components.barbecue.BaseBarcodeProvider.createBarcode(BaseBarcodeProvider.java:40)    at net.sf.jasperreports.components.barbecue.BarcodeProviders.createBarcode(BarcodeProviders.java:110)    ... 17 more

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

The error indicates that the data you are passing has an invalid length. Can you ensure the data you are passing to the barcode matches with the encoding standard? EAN-13 barcode requires 13 digits, UPC-A barcode requires 12 digits. Please provide sample JRXML and Json files if you still continue to face issues.