日期:2014-05-17 浏览次数:20780 次
<result name="fwjcprint" type="jasper"> <param name="location">/jasper/fwjcdReport.jasper</param> <param name="format">HTML</param> <param name="dataSource">bcpjcdVoList</param> </result>
两个JAVABEAN //主表的数据源 public class BcpjcdVo{ private String jcdid; ...... List<BcpjcdmxVo> bcpjcdmxList; .....} //子报表的数据源 public class BcpjcdmxVo{ private String mxid; private String bcpmc; .....}
public String printUI(){ ...... String jcdid = ServletActionContext.getRequest().getParameter("jcdid"); BcpjcdVo jcdVo = fwjcdDaoJDBC.queryBcpjcdByJcdid(jcdid); List<BcpjcdmxVo> bcpjcdmxVo = fwjcdDaoJDBC.queryBcpjcdMxByJcdid(jcdid); ServletActionContext.getRequest().setAttribute("jcdmxList", bcpjcdmxVo ); jcdVo.setBcpjcdmxList(ycljcdmxVo);//当我设置时就会报错,不设时就没有问题 this.setBcpjcdVo(jcdVo); ...... return FWJCPRINT; }