Email Templates
Submitted by Ben_Charlton on Sat, 15/10/2022 - 11:57
I had an idea to generify email templates like we have document templates
ie Create default header and email templates that are included as subreports.
Initial this worked I had created an email template like below.
The datasource for the subreports was
$P{dataSource}.getDataSource("customer")
While this worked when the parent report was supplied with an ACT.
This fell over as soon as I wanted to create the generic template. We set the datasource as $patient in the template settings in Open and the subreport is set to pass the datasource is
$P{dataSource}
However, this fails. It appears the subreport doesn't fill. We changed the subreport because we can't guarantee the context.
Any tips to get this up and working.
Re: Email Templates
Files
Re: Email Templates
You can't pass the parent data source to the subreport, as the single record has been consumed generating the parent.
Try using the getExpressionDataSource() for the data source expression e.g.
will pass the current customer to the sub report.