ireport子报表问题,各位帮帮忙
Struts2中的配置文件
<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; }