gpt4 book ai didi

java - Jasper Report jar 库必须包含在 java 项目中

转载 作者:行者123 更新时间:2023-12-02 10:23:55 26 4
gpt4 key购买 nike

我在这段代码中使用 JasperReport。

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JRDesignQuery;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.view.JasperViewer;

public void printData(String report , String printQuery){
try{
jasperDesign = JRXmlLoader.load(report);
query.setText(printQuery);
jasperDesign.setQuery(query);
jr = JasperCompileManager.compileReport(jasperDesign);
jp = JasperFillManager.fillReport(jr,null, databaseHandler.getConnection());
JasperViewer.viewReport(jp,false);

}catch (JRException ex) {
AlertMaker.showException("Exception Occurred ! " , ex.toString());
}
}

谁能帮我告诉java项目中需要包含哪些jar库文件?因为包括JasperReport的所有jar文件降低项目性能(这些jar lib文件超过60个)

最佳答案

基本上,这些是强制性的 jar,其余的您可以根据您的要求添加。

......poi-3.7-20101029.jar        ###support poi 
......commons-beanutils-1.8.0.jar
......commons-collections-3.2.1.jar ## for Collections
......commons-digester-2.1.jar
......commons-javaflow-20060411.jar
......commons-logging-1.1.1.jar ### for logging's
......groovy-all-2.0.1.jar
......iText-2.1.7.js2.jar ### for pdf
......jcommon-1.0.15.jar
......jfreechart-1.0.12.jar

关于java - Jasper Report jar 库必须包含在 java 项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54121963/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com