wkwjsrjehenr Posted June 7, 2019 Share Posted June 7, 2019 Main report <subreport> <reportElement stretchType="RelativeToTallestObject" x="24" y="10" width="548" height="623" uuid="198e6ba0-fa45-47af-8d87-2325efd48899"/> <subreportParameter name="p_s_hostname"> <subreportParameterExpression><![CDATA[$P{p_s_hostname}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{p_l_resultTypeTwo}]]></dataSourceExpression> <subreportExpression><![CDATA["report/result_sub.jasper"]]></subreportExpression> </subreport> Subreport <subreport> <reportElement x="20" y="10" width="509" height="70" uuid="440f2f73-a20a-4738-860e-b4078f7edeab"/> <subreportParameter name="p_s_hostname"> <subreportParameterExpression><![CDATA[$F{commentList}]]></subreportParameterExpression> </subreportParameter> <subreportExpression><![CDATA["report/comment.jasper"]]></subreportExpression></subreport>JAVAList <DataMap> list = isptResultService.selectResultTypeOneForReport(param); for (int i = 0; i < list.size(); i++) { DataMap map = list.get(i); List<DataMap> itemResultList = isptResultService.selectIsptItemResultList(map); map.put("itemResultList", itemResultList); List<DataMap> commentList = isptResultService.selectIsptCommentListForReport(map); for(int j = 0; j<commentList.size(); j++) { commentList.get(j).put("P_S_HOSTNAME", ConfigUtils.getString("SYSTEM.SITE.ADDR")); } map.put("commentList", new JRBeanCollectionDataSource(commentList)); } model.addAttribute("p_l_resultTypeTwo", new JRBeanCollectionDataSource(list));In the main report, I used a field variable declaration to pass a parameter to a subreport. I want to send a commentList from a subreport to a subreport.but net.sf.jasperreports.engine.fill.JRFillSubreport - Fill 2: exceptionIn the main report, there is a value of p_l_resultTypeTwo.In the main report, there is no value for commentList.What is the problem? Link to comment Share on other sites More sharing options...
Solution rodrigo_43 Posted June 8, 2019 Solution Share Posted June 8, 2019 You only show the first row of the error stack trace, show a bit more to see maybe what error actually is about Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now