java - ireport iterating through data Collection and accesing fields -
i want create simple report jasper ireport. don't know how iterate thought object c fields. purpose created sub report. example of classes:
public class d { private a; private b b; private arraylist<c> c; //getters setters } public class c { int id; string name; // getters setters }
in main report declared :
<subreport> ..... <datasourceexpression><![cdata[new net.sf.jasperreports.engine.data.jrbeancollectiondatasource($f{c})]]></datasourceexpression> <subreportexpression><![cdata["c:\\path\\report1_subreport2.jasper"]]></subreportexpression> </subreport>
in sub report :
<field name="c" class="java.util.collections"/>
my question: how access fields of class c?
i tried change class java.util.collections
c, create fields names of c nothing helps.
when define fields, follows
<field name="c.id" class="java.lang.string"/>
<field name="c.name" class="java.lang.string"/>
where c object and, id , name fields of class c. make changes in class in code.
Comments
Post a Comment