Dynamically populate a caption

You can dynamically populate a caption with values from a data source.

For example, you can populate a caption with a product name in French. The schema you connect to could have the following defined for a caption:

<form> 
      <caption product="ProductName1"></caption> 
</form>

The data file you point to could have the following defined for a caption:

<form> 
      <caption product="Desk Lamp"></caption> 
</form>

When you merge the data file with the form design, the caption Desk Lamp is displayed for product.

Another example could be to provide the product name in another language. The data file you point to could have the following defined for caption:

<form> 
      <caption product="Lampe de Bureau"></caption> 
</form>

When you merge the data file with the form design, the caption Lampe de Bureau is displayed for product.

Note: To use non-ASCII text (such as accents) in your data file, ensure the file is suitably encoded and the encoding is correctly identified in the XML processing instruction. For example:

<?xml version="1.0" encoding="UTF-8"?>

Before you perform this task, you must ensure the following settings are in effect:

  1. In the Object Library palette, click the Standard category and drag an object onto the form design.

    For example, insert a Text Field object.

  2. (Optional) In the Object palette, click the Field tab and type a caption for the object in the Caption box.

    For example, type Product.

  3. Click the Caption active label.

  4. Select the data connection.

    Note: If you are not already connected to a data source, Default Data Binding is the only selection in the Data Connection list.
  5. Click the triangle beside the Binding box and select a binding.

    For example, caption > @product.

    Note: When you bind a caption to a data source, the caption is always shown in the form, even if you have set Caption Position in the Layout tab to None.
  6. Click OK.

  7. View the form in the Preview PDF tab.

// Ethnio survey code removed