[]
        
(Showing Draft Content)

Formatted Text

The Formatted Text control can perform mail merge operations, and it displays richly formatted text in HTML. You can format the Formatted Text report control by entering HTML code into the Html property. You can freely expand the content of the report through HTML coding.


Formatted Text Control

Using Formatted Text Control in Report Designer

Follow the steps below to add a Formatted Text control:

  1. From the Report Toolbox on the left, drag and drop the Formatted Text control onto the design area or left-click the control.


    Drag Image Control


    You can also add it to the List control.

  2. Select the control, then click the Properties tab to display a list of related properties.


    Click Properties Tab


Properties Tab

You can customize the appearance and behavior of the Formatted Text control using the Properties tab.

Property Section

Property Description

Common

- Name: Sets the name of the control.

Content

- Html: Enter HTML code. All content must be enclosed in <body></body> tags. Use the Data Binding option to enter an expression.

- Encode Merge Fields: Set to True to encode mail merge fields.

- Merge Fields: Add mail merge fields with the + button and delete with X.

Each field includes:

 • Field Name: Used inside <%FieldName%> tags.

 • Value: Expression to pull data (use Pick Data to select).

Data Binding Option

Background

- Color: Choose background color.

- Image: Choose from Shared, Embedded, or Database sources.

Click the Expand icon to configure:

 • Source

 • Value

 • MIME Type

 • Repeat, NoRepeat, RepeatX, or RepeatY

Image Expand Icon

Border

- Width, Style, and Color of all sides can be set individually via the Expand icon.

Dimensions

- Left, Top, Width, Height

Layout

- Style: Theme

- Layer Name: Report layer

- Z-Index: Layer stacking order

Visibility

- Hidden: True or False

- Toggle Item: Another control can toggle visibility

Data

- Element Name: For XML output

- Element Output: Auto, Output, NoOutput, or ContentsOnly

Misc Options

- Tooltip: Mouse hover text

- Label: Used in Table of Contents

- Bookmark: Identifier for jump navigation


Using Mail Merge in Formatted Text Control

The following example shows how to create a mail merge report using the Formatted Text control to display product data.

Goal: Show Product, Discount, Start Date, and End Date for each unique product.

Steps:

  1. Drag and drop a List control onto the design area and bind it to a dataset.


    List Control and Binding it to Dataset


  2. Go to the Properties tab and set the Data Set Name under the Data section.

  3. Under the Group section, click the + icon to add Group Expressions.


    Adding Group Expressions


  4. Click Data Binding and select the ProductKey field.


    Product Key


  5. Drag and drop the Formatted Text control into the List data region.


    Adding Formatted Text to List


  6. Set Encode Merge Fields to True.

  7. Add the following Merge Fields using the Add Item icon:

    Field Name

    Value

    Field1

    = Product

    Field2

    = Discount

    Field3

    = Start Date

    Field4

    = End Date

    Adding Field Value Pairs


  8. Set the Html property by clicking Data BindingExpression.


    Expression Option


  9. In the Expression Editor, enter this HTML:

    <body>
      Product <%Field1 /%> is at a discount of <% Field2 /%>%. 
      Offer starting on <% Field3 /%> and ending on <% Field4 /%>. 
      Hurry Up. Limited Stock!
    </body>
  10. Format the appearance of the report control and preview it.


    Mail Merge Report Preview