Jasper Subreport Null Values

I am creating a report in Jasper, simply passing the foundset for a datasource, where the main report has some basic information and my sub-report contains info from a relation. When I run the report through Servoy the main section is rendered normally and the sub-report static text is there but the sub-report has nulls for all of my fields. The relation does contain info so I don’t know why it’s not showing up.

This is how I am including my sub-report.

On the subreport I defined this simple field $F{myrelation.id}

Am I missing something? Any help would be appreciated, thanks.

you pass an empty datasource as the data fro the subreport, that will not work.

You have to pass the relation to the report and define the fields / relations from the relation-foundset in the subreport.

It looks like this in our reports:
field

<field name="bautagebuch_wetter_to_bautagebuch_firmen" class="net.sf.jasperreports.engine.JRDataSource"/>

subreport:

<subreport>
[...]
	<dataSourceExpression><![CDATA[$F{bautagebuch_wetter_to_bautagebuch_firmen}]]></dataSourceExpression>
	<subreportExpression><![CDATA[com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadReport($P{SVY_SUBREPORT_DIR} + $P{SVY_REPORT_DIR} + "bautagebuch_vhb_komplett_anwesenheit.jrxml")]]></subreportExpression>
</subreport>

tomasz.jarosz:
I am creating a report in Jasper, simply passing the foundset for a datasource, where the main report has some basic information and my sub-report contains info from a relation. When I run the report through Servoy the main section is rendered normally and the sub-report static text is there but the sub-report has nulls for all of my fields. The relation does contain info so I don’t know why it’s not showing up.

This is how I am including my sub-report.

On the subreport I defined this simple field $F{myrelation.id}

Am I missing something? Any help would be appreciated, thanks.

Thanks Robert, you the man!