使用DynamicJasper评估源文本的表达式时出错:ar.com.fdvs.dj.core.BarcodeHelper

问题描述

使用DynamicJasper打印条形码时出现以下错误

评估源文本的表达式时出错:ar.com.fdvs.dj.core.BarcodeHelper.getBarcodeImage(10,$ F {value},false,false,'',0,0)

程序如下:

    ArrayList<HashMap> lines;
    HashMap line;
    
    lines = new ArrayList<>();
    line = new HashMap();
    line.put("value","5901234123457");
    lines.add(line);
    line = new HashMap();
    line.put("value","5901234123457");
    lines.add(line);
    
    FastReportBuilder frb = new FastReportBuilder();
    frb.addColumn("Code","value",String.class.getName(),100,false,null);
    frb.addBarcodeColumn("Barcode",BarcodeTypes.EAN13,500,ImageScaleMode.FILL);

    DynamicReport dr = frb.build();
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr,new ClassicLayoutManager(),lines);
    JasperExportManager.exportReportToPdfStream(jp,response.getoutputStream());

我具有以下依赖性:

    <!-- https://mvnrepository.com/artifact/ar.com.fdvs/DynamicJasper -->
    <dependency>
        <groupId>ar.com.fdvs</groupId>
        <artifactId>DynamicJasper</artifactId>
        <version>5.3.1</version>
        <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/ar.com.fdvs/DynamicJasper-core-fonts -->
    <dependency>
        <groupId>ar.com.fdvs</groupId>
        <artifactId>DynamicJasper-core-fonts</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>

也许我缺少条形码的依赖项或字体。但我不知道。
感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)