# Rtf Field

## Content

The **Rich Text Formatted (RTF)** field is used to display a formatted text. When you click this button, a menu appears where you can select other fields that are contained in the same report definition file to be displayed in RTF format. These are data-bound RTF fields.

RTF fields are particularly used in creating Mail Merge reports.

To create a mail merge using RTF field in FlexReportDesigner application:

1. Create a new report FlexReportDesigner.
2. Bind the report to 'Customers' and 'Orders' Table by giving the following Sql statement:

    ```auto
    SELECT
    Customers.CustomerID, Customers.CompanyName,
    Customers.ContactName, Customers.Address,
    Customers.City, Customers.Region, Customers.Country, Customers.PostalCode,
    Orders.OrderID, Orders.OrderDate, [Order Subtotals].Subtotal
    FROM Customers INNER JOIN ([Order Subtotals] INNER JOIN Orders
    ON [Order Subtotals].OrderID = Orders.OrderID)
    ON Customers.CustomerID = Orders.CustomerID
    WHERE CompanyName = "Ernst Handel"
    ```
3. From the **Insert** tab add the **RTF** field ![RTF text field icon](https://cdn.mescius.io/document-site-files/images/4f10fc8d-eb38-4687-8264-468b8828236a/images/rtf-icon.png).
4. From the Properties window, set the Background color to a light color.
5. Set the **Text** property to following expression:
<br>
    `"Dear " + ContactName + "," + vbcrlf + vbcrlf + _` <br>         `"Your order for past year totals to " + Format(Subtotal, "Currency") + vbcrlf + vbcrlf + _`<br >   `"Because you have been such a terrific customer, " + _`<br >         `"we decided to credit your account with $0.10. The amount will be credited in next 10 days._`<br >         `Your Address for future correspondance is "+"Address" + vbcrlf + vbcrlf + _`<br>         `"Congratulations!"`
6. Arrange the fields as shown.
<br>
    ![RTF text field](https://cdn.mescius.io/document-site-files/images/4f10fc8d-eb38-4687-8264-468b8828236a/images/rtffield-design.png)
7. Preview the report.
<br>
    ![RTF field preview](https://cdn.mescius.io/document-site-files/images/4f10fc8d-eb38-4687-8264-468b8828236a/images/rtffield-preview.png)