Embedded Fields (Mail Merge)
The standard way of binding report controls in Advanced Reports requires adding a data binding to a control's DataBindings collection. In this case, you're able to bind a number of bindable properties available for the current report control, and specify the format string for each of them. In this instance, it is impossible to specify more than one data binding for a single property, while Mail Merge allows multiple data fields to be merged into the text.
Mail merge can be applied to the control's Text property only.
To create an embedded field, you need to insert a data field name with [brackets] into the control's text (e.g. Label or Rich Text). Field names must not use either dots or spaces to be correctly interpreted.
If this field is valid in the current data context, it will be replaced with an appropriate data value when a report is previewed or exported.
If a data field inserted into the label's text is valid, then you will see the yellow database barrel icon shown above the control. The same barrel is shown if a control was bound via the Control's Data Bindings property. Since this data field is inserted into a label's text, you may also use any prefix or postfix to your data. You can also insert several embedded fields into the Text of a single control, and all these embedded fields will be processed correctly.
The simple example report shown below demonstrates the use of the mail merge.
The output of the above report design looks as follows:
The text with square brackets must be set to the Control's Text at design time. Also, if the text which is stored in a report's Data Set and is placed into a report control via a data binding that also contains square brackets, this will not enable the mail merge feature.
The following controls support mail merge:
- Bar Code
- Check Box
- Label
- Rich Text
- Table Cell
- Zip Code