Spring2.0集成iReport报表技术概述
Spring2.0集成iReport报表技术概述
文章分类:Java编程
首先是你要下载关于iRport的lib文件,这可以在你下载的jasperReport中全部找到,因为什么版本编译的模板文件之中用对应的版本进行解析,所以要保持你工程中与模板设计的一致性!
首先在web.xml声明关于模板访问的路径例如:
org.springframework.web.servlet.DispatcherServlet
以及他的映射Path:
接下来按照SpringMVC的一般规则,需要在WEB-INF的文件夹下面家里一个repdpt-servlet.xml文件,内容如下:
xmlns:xsi="https://www.360docs.net/doc/674096223.html,/2001/XMLSchema-instance" xmlns:util="https://www.360docs.net/doc/674096223.html,/schema/util" xmlns:aop="https://www.360docs.net/doc/674096223.html,/schema/aop" xsi:schemaLocation=" https://www.360docs.net/doc/674096223.html,/schema/beans https://www.360docs.net/doc/674096223.html,/schema/beans/spring-beans-2.0.xsd https://www.360docs.net/doc/674096223.html,/schema/util https://www.360docs.net/doc/674096223.html,/schema/util/spring-util-2.0.xsd https://www.360docs.net/doc/674096223.html,/schema/aop https://www.360docs.net/doc/674096223.html,/schema/aop/spring-aop-2.0.xsd"> class="org.springframework.web.servlet.view.XmlViewResolver"> class="com.ecpay.mvc.ftlview.report.Handle.SimDailyReportCont rollerHandle"> class="com.ecpay.mvc.ftlview.report.SimDailyReportController" > value="jasperReportsHtmlView"> ref="simDailyReportControllerHandle"> class="org.springframework.web.servlet.handler.SimpleUrlHandl erMapping"> simDailyReportController
关于视图解析引擎的文件的配置:
xmlns:xsi="https://www.360docs.net/doc/674096223.html,/2001/XMLSchema-instance" xmlns:util="https://www.360docs.net/doc/674096223.html,/schema/util" xmlns:aop="https://www.360docs.net/doc/674096223.html,/schema/aop" xsi:schemaLocation=" https://www.360docs.net/doc/674096223.html,/schema/beans https://www.360docs.net/doc/674096223.html,/schema/beans/spring-beans-2.0.xsd https://www.360docs.net/doc/674096223.html,/schema/util https://www.360docs.net/doc/674096223.html,/schema/util/spring-util-2.0.xsd https://www.360docs.net/doc/674096223.html,/schema/aop https://www.360docs.net/doc/674096223.html,/schema/aop/spring-aop-2.0.xsd"> class="org.springframework.web.servlet.view.jasperreports.Jas perReportsXlsView"> value="/WEB-INF/jasper/dailyReport_tmp.jasper"> class="com.ecpay.mvc.ftlview.report.JasperReportsGB2312HtmlVi ew"> value="/WEB-INF/jasper/dailyReport_tmp.jasper">