Passing data to subreport

2019-08-27 14:12发布

I am a a beginner in this topic. In my Java code I create a HQL query:

List <User> listOfDetails = session.createQuery("from User").list();

I would like to fill my subreport using data form above query. How should I complete the following code:

<dataSourceExpression><![CDATA[]]></dataSourceExpression>

1条回答
神经病院院长
2楼-- · 2019-08-27 14:54

Use <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{listOfDetails})]]></dataSourceExpression>.

查看更多
登录 后发表回答