Progress
Report Builder
User’s Guide


Preparing the Memo File

The first step in generating a form letter is to prepare the memo file. Before you can attach a memo file to a report, you must perform the following steps to prepare the memo field or fields in the text file:

  1. Identify each separate memo in the file.
  2. Mark the beginning and end of each memo with braces { }.
  3. Include field names in the text.
  4. Specify line endings.
  5. Specify tabs and indentation.
  6. Apply fonts, point sizes, and styles to text in memo fields.

Because you can use only one memo file per report, be sure to include all the memo fields you require for the report in the same file. Within this file, you might have many named memos — one or more of which can be included in your report. There is no limit to the length of the memo file or to the number of memo fields you can have in the file.

Figure 14–5 shows an example of a properly formatted memo file named Recall.

NEWMEMO Recall:
{
Dear {@Contact},

This letter is to inform you that we are recalling our All Around Sports 
{@Item-Name}, which is Item number: {@Item.Item-num}, because independent 
testing has found that normal use of this product can possibly cause injury.

Please call your sales representative to make arrangements for returning any 
{@Item-Name} that you have in stock. If you have sold any {@Item-Name}, please 
attempt to retrieve them.

We apologize for any inconvenience or injury this product may have caused.



Sincerely,


Todd A. Winmill~n
Quality Assurance Manager
} 

Figure 14–5: Recall Memo File

This memo file is the text of a recall form letter. The following sections use excerpts from this memo file as examples to describe how to format the memo file.

Identifying Each Memo Field

Regardless of the number of memo fields included in your report, you must name each memo with a unique name. Memo names follow the same rules as 4GL field names. They can be up to 32 characters long and can consist of alphabetic characters (A-Z, a-z), digits (0-9), and special characters ($, &, #, %, -, and _). In addition, memo names must begin with a letter (A-Z or a-z). The field name must also be unique within this report and cannot contain spaces.

Follow these steps to properly annotate a memo file:

  1. Create or open a memo file in an editor or word processing program that allows you to save the file as an unformatted text file or ASCII file.
  2. Identify each memo field in the file using the following format:
  3. NEWMEMO fieldname: 
    

    You must enter each memo field name on a separate line before the text, starting in the first column.

Marking the Beginning and End of Each Memo Field with Braces { }

Use the left brace, {, to mark the beginning of each memo field and a right brace, }, to mark the end. The left brace must be the first character on the line that follows the memo field name. In Figure 14–6 note the braces that highlight the beginning and end of the memo field.

NEWMEMO Recall:
{
Dear (customer name),

This letter is to inform you that we are recalling our All Around Sports 
(item name), which is Item number: (item number), because independent 
testing has found that normal use of this product can possibly cause 
injury.

Please call your sales representative to make arrangements for returning 
any (item name) that you have in stock. If you have sold any (item name), 
please attempt to retrieve them.

We apologize for any inconvenience or injury this product may have 
caused.  


Sincerely,


Todd A. Winmill
Quality Assurance Manager
} 

Figure 14–6: Beginning and Ending Braces

Include Field Names in the Memo Field Text

You can merge data from tables into memo text by including field names. You can also include the names of calculated or aggregate fields created in the report to which you will attach the memo file. These fields are called embedded fields. When you merge the memo file with the report layout and generate the report, Report Builder inserts the proper data from the specified embedded fields into the memo field text.

Follow these steps to include embedded fields in the memo field text:

  1. In the text editor, position the cursor where you want the data to appear in the text.
  2. Type the field name preceded by the @ sign enclosed within curly braces . The @ sign and curly braces (for example, {@Contact}) distinguish the field name from the text. If the specified field appears in more than one table, you must precede the name of the database field with the table alias (for example, {@Item.Item-num}).

Figure 14–7 shows how to include the customer contact name, the item name, and the item number from the Newsport database in the memo file for use in the recall form letter.

NEWMEMO Recall:
{
Dear {@Contact},

This letter is to inform you that we are recalling our All Around Sports 
{@Item-Name}, which is Item number: {@Item.Item-num}, because 
independent testing has found that normal use of this product can 
possibly cause injury.

Please call your sales representative to make arrangements for returning 
any {@Item-Name} that you have in stock. If you have sold any 
{@Item-Name}, please attempt to retrieve them.

We apologize for any inconvenience or injury this product may have 
caused.
 


Sincerely,


Todd A. Winmill
Quality Assurance Manager 
} 

Figure 14–7: Embedded Field Names

When you include this memo field in your report, the customer contact name replaces {@Contact}, the item name replaces {@Item-Name}, and the item number replaces {@Item.Item-num}.

Specifying Line Endings

If you want Report Builder to preserve the line endings in your text, you must indicate where you want line endings to occur in your memo text by preceding a return with a line ending code, ~n. The initial return and any that immediately follow it cause Report Builder to begin a new line. Unless you indicate where line endings should occur in your text, Report Builder word-wraps the text within the width of the memo field, determining its own line endings.

For example, Figure 14–8 shows that to create a separate paragraph, you enter a return immediately followed by another return. Notice that to indicate a new line for the author’s title in the closing salutation, you must enter the ~n code at the end of the line containing the author’s name.

NEWMEMO Recall:
{
<FArial><P10>
Dear {@Contact},

This letter is to inform you that we are recalling our <FHelvetica><B>All 
Around Sports {@Item-Name}<N><FArial>, which is Item number: 
{@Item.Item-num}, because independent testing has found that normal use 
of this product can possibly cause injury.

Please call your sales representative to make arrangements for returning 
any {@Item-Name} that you have in stock. If you have sold any 
{Item-Name}, please attempt to retrieve them.

We apologize for any inconvenience or injury this product may have 
caused.



Sincerely,


Todd A. Winmill~n
Quality Assurance Manager
} 

Figure 14–8: Line Ending Codes

You can also indicate where you want line endings followed by blank lines by including multiple returns. For example, in Figure 14–8, the series of four returns following the last paragraph results in three blank lines.

NOTE: Report Builder preserves blank lines in memo fields only when the fields have a word-wrap format. If you apply a format other than word-wrap in the report layout, Report Builder changes blank lines in memo field text into a single space in your report.

Specifying Tabs and Indentation

If you want Report Builder to preserve horizontal spacing, such as paragraph indentations in the text, you must specify it. The type of word processor or editor you use dictates whether you use the SPACEBAR or TAB keys to specify spacing:

If the word processor or text editor represents tabs as. . .

Then use. . .
The TAB character (usually indicated by an arrow)
SPACEBAR. Report Builder treats a tab character as a single space. Space represented in the memo field text as one or more tab characters is not preserved when you generate the report.
A number of spaces
TAB. Report Builder preserves spaces inserted in the memo field text when these spaces are at the beginning of a paragraph (as in a paragraph indentation). Spaces that are inserted elsewhere in the text are preserved, unless Report Builder’s word-wrap places them against the left margin of the report. In this case, the spaces are eliminated.

NOTE: Report Builder ignores control characters (such as form feeds) included in the text. It converts both the TAB character (character code 9) and a single carriage return into a space.

Applying Fonts, Point Sizes, and Styles to Text in Memo Fields

You can include special codes that apply fonts and/or styles to portions of the text or to embedded fields included in the text. Any fonts or styles you specify in the text itself override fonts or styles applied to the memo field on the report layout.

NOTE: Report Builder does not preserve any fonts or styles you have applied in the word processor or text editor.

You can apply any font, point size, or style available on the currently selected MS-Windows printer. You can apply the underscore style to words and/or fields that print in any font.

You can combine fonts, point sizes, and styles. For example, if you apply a style without specifying a font, Report Builder combines the specified style with the font that is applied to the field in the report layout. However, a font or point size remains in effect until Report Builder encounters a font off code (<D> or <d>), a code for another font, or the end of the memo field.

You can specify any combination of font, point size, or style. Point sizes can have up to three integer places and one decimal place.

Follow these steps to apply fonts to selected text and/or embedded fields:

  1. Position the cursor before the text where you want to apply the font.
  2. Specify the font code using <Ftypeface> or <ftypeface>, where typeface is the typeface name. You can enter the typeface name in uppercase, lowercase, or mixed case.
  3. Position the cursor before the text where you want to apply the point size.
  4. Specify the point size using <Psize> or <psize> where size is the number indicating point size.
  5. Specify the end of the font by either entering another font code, <D> or <d>, to return to the font and attribute applied to the memo field in the report layout.
  6. Position the cursor before the text where you want to apply the style.
  7. Specify the desired style code. Table 14–1 lists the valid codes.
  8. Table 14–1: Memo File Style Codes 
    Style
    Code
    Bold
    <B> or <b>
    Italic
    <I> or <i>
    Underscore
    <U> or <u>
    Normal
    <N> or <n>

    You can combine codes, other than N, within angle brackets (for example, <BI> for bold and italic).

  9. Specify the end of the style by entering another style code, <D> or <d>, to return to the font and attribute applied to the memo field on the report layout.

In Figure 14–9, the <FArial> and <P10> codes on the third line apply 10-point Arial font to all the text until the <FHelvetica> code. The <FHelvetica> code on the seventh line supercedes the previous font code and applies 10-point Helvetica to all the text following the code until Report Builder encounters another font code, including the embedded data fields. The <B> code applies the bold style to the embedded data fields. Notice that style codes supersede each other, and that you must specify the Normal style for the text that follows the embedded data fields. The second <FArial> code supercedes the <FHelvetica> code and remains in effect until the end of the memo.

NEWMEMO Recall:
{
<FArial><P10>
Dear {@Contact},

This letter is to inform you that we are recalling our <FHelvetica><B>All 
Around Sports {@Item-Name}<N><FArial>, which is Item number: 
{@Item.Item-num}, because independent testing has found that normal use 
of this product can possibly cause injury.

Please call your sales representative to make arrangements for returning 
any {@Item-Name} that you have in stock. If you have sold any 
{Item-Name}, please attempt to retrieve them.

We apologize for any inconvenience or injury this product may have 
caused.



Sincerely,


Todd A. Winmill~n
Quality Assurance Manager
} 

Figure 14–9: Embedded Style Codes

When you insert this memo field in a report, the text prints in the specified fonts (Arial and Helvetica) if these fonts are available on the current printer. These fonts override any font applied to the memo field on the report layout. However, if you apply a style to the memo field in the report layout, Report Builder tries to combine that style with the specified font.

Figure 14–10 shows the form letter generated with this memo field.





08/02/95


Gloria Shepley
Lift Line Skiing
276 North Street
Boston, MA 02114

Dear Gloria Shepley,

This letter is to inform you that we are recalling our All Around Sports Swim 
Goggles, which is Item number: 00009, because independent testing has found that 
normal use of this product can possibly cause injury.

Please call your sales representative to make arrangements for returning any Swim 
Goggles that you have in stock. If you have sold any Swim Goggles, please attempt to 
retrieve them.

We apologize for any inconvenience or injury this product may have caused.


Sincerely,



Todd Winmill
Quality Assurance Manager 

Figure 14–10: Recall Form Letter


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095