一、下载、编译jasperreports
1.下载jasperreports-6.5.1-project.zip
https://community.jaspersoft.com/project/jasperreports-library/releases
解压到D:\program,切换到demo目录,执行ant
D:\program\report\jasperreports\jasperreports-6.5.1\demo\samples>ant
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-D:\Program Files\apache-ant-1.10.3\lib
-C:\Users\ShaoRongFan\.ant\lib
-a directory added on the command line with the -lib argument
Total time: 0 seconds
2.下载apache-ivy-2.5.0-rc1-bin.zip
https://ant.apache.org/ivy/download.cgi
解压将ivy-2.5.0-rc1.jar放到ant的lib目录,再次执行ant,在sapmples目录执行很慢,进入示例目录单个执行
D:\program\report\jasperreports\jasperreports-6.5.1\demo\samples\alterdesign>an
t
3.查看ant viewDesign
4.导入代码到Jaspersoft Studio-6.6.0
添加JasperReports Libraries、JasperReports Library Dependencies、JasperReports Server Library到path
运行AlterDesignApp的main方法
build下reports目录将生成AlterDesignReport.jrprint和AlterDesignReport.pdf
运行BarbecueApp
拷贝BarbecueApp.java到src目录,BarbecueReport.jasper到build下reports目录
添加commons-codec-1.9.jar到build path
run configurations添加参数test,运行