• ireport jasperreports4.7.0 生成pdf各种sb问题总结


    本贴记录本人今天遇到的各种sb问题以及解决方案.


    1.

    net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :

    pdfFontName   : STSong-Light

    pdfEncoding   : UniGB-UCS2-H

    isPdfEmbedded : false

    加入3个jar包:iTextAsian.jar iTextAsianCmaps.jar iTextAsian.jar


    2.

    java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester

    出现上述错误提示加入

    commons-digester-1.7.jar   iReport/lib  功能简述:解析 xml 文件;

    3.

    java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap

    出现上述错误提示加入

    commons-collections-2.1.jar   iReport/lib


    3.

    Exception in thread "main" java.lang.NoSuchFieldError: APPDEFAULT / PRINTSCALING
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:496)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:388)
    at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:122)
    at com.iphone.servlet.Test.main(Test.java:58)


    JasperReport需要使用的iText.jar版本升级到iText-2.1.7.jar


    4.

    NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

    Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

    at java.lang.Class.getDeclaredConstructors0(Native Method)

    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)

    at java.lang.Class.getConstructor0(Class.java:2699)

    at java.lang.Class.getConstructor(Class.java:1657)

    at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:690)

    at net.sf.jasperreports.engine.JasperCompileManager.getEvaluator(JasperCompileManager.java:263)

    at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:457)

    at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:379)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)

    at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)

    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:55)

    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)

    at net.sf.jasperreports.engine.JasperFillManager.fillToFile(JasperFillManager.java:228)

    at net.sf.jasperreports.engine.JasperFillManager.fillToFile(JasperFillManager.java:124)

    at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:666)

    at com.riambsoft.report.pdf.PdfReportM3.writePdfWithJasper(PdfReportM3.java:166)

    at com.riambsoft.report.pdf.PdfReportM3.load(PdfReportM3.java:86)

    at com.riambsoft.report.Report.<init>(Report.java:97)

    at com.riambsoft.report.pdf.PdfReport.<init>(PdfReport.java:13)

    at com.riambsoft.report.pdf.PdfReportM3.<init>(PdfReportM3.java:36)

    at com.riambsoft.report.pdf.PdfReportFactory.create(PdfReportFactory.java:36)

    at com.riambsoft.report.pdf.ThreadTestReportFactory$ImportThread.run(ThreadTestReportFactory.java:115)


    添加groovy-all.jar


    maven官网下载jar包,http://search.maven.org/#artifactdetails%7Corg.codehaus.groovy%7Cgroovy-all%7C2.1.1%7Cjar


  • 相关阅读:
    linux 之 系统监控
    Spring Cloud Eureka 常用配置及说明
    mysql的事务隔离级别
    什么场景中会用到java多线程(转)
    springboot配置druid连接池
    MyBatis标签详解(转)
    关于@JsonSerialize注解的使用方法
    layer绑定回车事件(转)
    php7+apache2.4配置
    Eclipse创建Maven项目不支持el表达式的解决方式
  • 原文地址:https://www.cnblogs.com/ae6623/p/4416573.html
Copyright © 2020-2023  润新知