http://blog.csdn.net/jia20003/article/details/8471169
注意其中的图片地址说明;
如果有子报表,也会到class文件夹中去寻找;
如果子报表有路径的话,还是可以传递进去的;
参数传递的方式:
org.springframework.ui.Model.addAttribute('pname',pvalue);
这个例子也可以实现:
http://blog.csdn.net/xht555/article/details/43409637
把jasper输出为word格式的viewer类:
import net.sf.jasperreports.engine.JRExporter; import net.sf.jasperreports.engine.export.JRRtfExporter; import org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsSingleFormatView; public class JasperReportsWordView extends AbstractJasperReportsSingleFormatView { public JasperReportsWordView() { setContentType("application/vnd.ms-word"); } @Override protected JRExporter createExporter() { // return new JRRtfExporter();
return new JRDocxExporter(); //这种输出格式文件要小好多倍;
} @Override protected boolean useWriter() { return false; } }