Use Embedded Fields (Mail Merge)
- 2 minutes to read
This topic describes how to use Mail Merge to bind report controls to data. This feature allows you to create templates where data source values populate specific placeholders while other text remains constant.
You can apply mail merge to the following controls' Text:
Embed Fields in a Control Text
You can apply mail merge to the Text property only. Double-click a control on the design surface to invoke the in-place editor. Insert data field names with square brackets to create embedded fields and use any prefixes or postfixes.
You can also refer to collection elements or nested properties.
Use the [?ParameterName] syntax to embed a parameter's value into a control's content.
A database barrel icon is displayed above the control if embedded fields are valid for the report's data source and data member. The same icon appears if you specify a binding expression for the control.
In the Rich Text control, you can select any text part and use the formatting toolbar to adjust its color and font.
Embedded fields are replaced with values obtained from the report's data source when users preview or export the report:
Format Embedded Fields
Mail merge enables you to apply formats to embedded field values. Select a data field and expand the control's smart tag. Click the Format String property's ellipsis button and choose a built-in format pattern in the invoked Format String Editor.
This adds the selected format to the data field. The format specifier is separated from the field name with the ! character and applies this format to field values when users preview or export a document.