struts2整合jasper模版生成PDF导出下载<二>
jasperreport模版制作过程可参见:
http://www.blogjava.net/heis/archive/2009/02/16/254978.html
模版规则参见:
http://blog.csdn.net/czp0608/article/details/7354030
二,添加项目依赖包:
结合ireport4.1.3,项目需要添加相关jar包依赖,特别注意的jar的版本必须兼容ireport模版,否则会解析出错。
我们在maven项目的pom.xml添加依赖包(需要现在资源库添加这些jar包供下载):
<dependency><groupId>net.sf.jasperreports</groupId><artifactId>jasperreports</artifactId><version>4.1.3</version></dependency><dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7.1</version> </dependency><dependency> <groupId>jfree</groupId> <artifactId>jfreechart</artifactId> <version>1.0.12</version></dependency><dependency><groupId>org.apache.struts</groupId> <artifactId>struts2-jasperreports-plugin</artifactId> <version>2.2.3</version></dependency><dependency><groupId>com.keypoint</groupId> <artifactId>png-encoder</artifactId> <version>1.5</version></dependency><dependency> <groupId>groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>iTextAsian</groupId> <artifactId>iTextAsian</artifactId> <version>4.1.3</version> </dependency> <dependency> <groupId>com.csair</groupId> <artifactId>commons-digester</artifactId> <version>1.7</version> </dependency><dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>2.1.1</version></dependency>