Email Templates

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Email Templates

Files

AttachmentSize
Email Template.jrxml 3.66 KB
email_header.jrxml 4.63 KB
email_footer.jrxml 4.89 KB
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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.

P{dataSource}.getExpressionDataSource("$OpenVPMS.customer")

will pass the current customer to the sub report.

Syndicate content