Rich Text Format

The Rich Text Format element is used to add RTF text in the report.

The Rich Text Format (RTF) is a file format developed by Microsoft that allows you to define text files with formatting, font information, text colour, etc.

Add RTF

To add a RTF text in the report, select the “Rich Text Format” button and click on the location where you wish to place the text. A “RTF Wizard” will appear.

There are two tabs in the wizard.

  • RTF
  • Scripts

RTF Tab

The “RTF” tab allows you to select the RTF file or add a RTF file based on the selected control source type.

There are four options for the “Control Source Type” field.

  • Field - Allows you to select a datasource
  • Script - Allows you to add a Java script for the RTF file
  • URL - Allows you to select the URL path to the RTF file from repository
  • Literal - Allows you to add a RTF file from a location path

Field

If the “Field” option is selected in the “Field Type” field, the following screen will appear.

If the “Data Source” field is empty, it means no datasource is selected for the report. Add a datasource to the report by clicking on the “Add” button to display the “Configure DataSoruce” dialog box. Select a desired datasource from the repository and configure the datasource as required. Click in the “Finish” button to add the datasource.

Select the desired field from the table.

Once added into the report, the datasource along with the field selected will appear as DataSource 1:FieldSelected in the location selected.

Script

If the “Script” option is selected, the following screen will appear.

Key in the Java script in the textbox.

URL

If the “URL” option is selected, the following screen will appear.

Key in the URL in the textbox or click on the button to display the repository dialog box to select the desired file.

Literal

If the “Literal” option is selected, the following screen will appear.

There are two ways to enter the RTF text. The most direct way is to key in the desired text in the texbox. Another way is to select a RTF file by clicking on the button on the left of the tab. A dialog box will appear to allow you to browse to the location of the RTF file. This way the RTF text to be displayed in the report can be dynamic, that is it will change according to content in the RTF file.

Click on the “Finish” button after the RTF text is finalised.

Scripts Tab

This tab has three panels which allows you to add Java scripts:

  • Render If
  • On Render Begin
  • On Render End

The JavaScript functions that are entered in these text boxes are executed when the data field is rendered.

Edit RTF

To edit the RTF element in the report template, double-click on the RTF element to display the “Properties” dialog box.

The tabs are similar to the RTF Wizard.