Creating the DataWindow object

StepsTo create a RichText DataWindow object:

  1. In the New dialog box, select RichText from the DataWindow tab and click OK.

  2. Select data for the DataWindow object as you do for any DataWindow object.

    If you want data to be retrieved into the Preview view automatically, select the Retrieve on Preview check box. For more information, see “Building a DataWindow object”.

  3. Specify settings for the DataWindow object on the Specify RichText Settings screen, click Next, and then click Finish.

    The sample shows the Rich Text Settings screen. At top is the Rich Text Bars box, which has check boxes for Tool, Tab, Ruler, Header / Footer, which is selected, Pop up Menu, which is also selected, and Display Only. Below that is the Background Color box with drop down list boxes for General and for Input field. Both display the selection Window Background.

Available settings

Table 30-1 describes the types of settings you can make for the RichText DataWindow object in the wizard.

Table 30-1: Wizard settings for RichText DataWindow objects

You can specify

With these settings

Tools available to the user

Rich text bars: Tool, Status, Ruler, and PopUp Menu

Whether there will be a header and footer for the printed DataWindow object

Header/Footer

Whether users are prevented from editing input fields and text

Display Only

Colors for the whole background and the background of input fields

Background Color: General and Input Field

Editing the content

After you click Finish in the wizard, you see input fields with their labels in the detail band in the Design view:

The sample shows the Design view as it might look after you finish with the wizard. The detail band displays input fields with the labels First Name, Last Name, Address, City, State, Zip, and Company Name. The first entry, for example, reads First Name : { F NAME }.

You can:

This sample shows how you might rearrange the input fields in a sales letter:

The sample shows the input fields rearranged as a letter in the Design view. The Detail band shows F Name L Name on the first line, left justified. Beneath it is a line for Company Name, a line for Address, and a line for City, State, and Zip. Below that is  a blank line and then the salutation Dear F Name : followed by another blank and a paragraph of text.

Editing text

You can add text by typing directly in the Design view. You do not have to create text objects as you do for other DataWindow object styles. The DataWindow painter's StyleBar lets you apply formatting to selected text. The RichText toolbars are not available in the painter.

NotePreview mode and editing text You cannot edit text in the Preview view, but you can edit it when you preview the DataWindow object by selecting File>Run/Preview from the menu bar. It may seem convenient to edit text in Preview mode because the toolbars are available. However, any changes you make to the text when previewing are temporary. They are discarded as soon as you return to the Design view.

Inserting a file

If you have a rich text file, you can include it in the DataWindow object. In the Design view, you can insert text from a file into the detail, header, or footer band.

StepsTo insert a file:

  1. Click in the text in any band to set the insertion point for the file.

  2. Right-click in the Design view and select Insert File from the pop-up menu.

  3. In the file selection dialog box, select the file you want to insert.

Only the body of the file is used. If the file has a header or footer, it is ignored.

Headers and footers

You decide whether your RichText DataWindow object has a header and footer by checking Header/Footer in the wizard or Rich Text Object dialog box (described in “Formatting for RichText objects within the DataWindow object”). The decision to include a header and footer must be made at design time; it cannot be changed at runtime.

To display a page number or a date in the header or footer, you can insert the predefined computed fields Page n of n or Today(). You do not need to write scripts to set the values of these fields for each page, as you do for the RichTextEdit control.