Application management : Business intelligence & reporting : Reports : Mail merge report definitions : Inserting flexible subreports in a mail merge report
Inserting flexible subreports in a mail merge report
A flexible subreport allows you to provide layout and positioning flexibility for subreport data inside mail merge templates, beyond what a simple subreport can do.
If you want to create a mail merge report in which individual field values appear within the same paragraph as your own descriptive text, you can insert a flexible subreport into the template.
The procedure to do this is identical to that described in To include sub reports in your report definition, however regarding the template used, the following must be adhered to:
The template used must be in either .doc, .docx or .rtf format.
The flexible subreport must be preceded and succeeded by a carriage return in the template.
The start of a flexible subreport is indicated by the tag [Start:flexible subreport name]. The end of the subreport is indicated by the tag [End:flexible subreport name].
* 
Tags are case sensitive and the capitalization must be observed.
The text and merge code tags between the start and end tag of the subreport are repeated for every record (that is, element) in the subreport.
Hard line breaks (ENTER) cannot be used between the start and end tags of the flexible subreport, otherwise an error occurs when generating the mail merge report. Soft line breaks (i.e. SHIFT+ENTER) can be used within the subreport.
When creating the template, write a paragraph of text as required and simply insert the field merge codes within the text.
The merge codes used in the template must match the merge codes defined in the Report definitions and settings dialog box for the fields included in the subreport. In addition, all merge codes in the subreport must be unique within the overall report definition.
For price announcement letters for contract lines, if you want to include the Period start date or Period end date fields in your report, complete the following steps:
1. Create an expression in the Report definitions and settings dialog box.
2. Enter a function that returns a date, e.g. currentDate().
3. Specify the date format in the Mask field of the dialog box.
4. Enter the merge code ‘PERIOD_BEGINDATE’ or ‘PERIOD_ENDDATE’
If you use the merge codes in the template they will be replaced with the Start date of period and End date of period as entered in the price announcement letter dialog box.
It is not possible to use tables or cells within in a flexible subreport