Creating Objects - Text Substitution

FormTrap allows you to change the text and graphics that are printed on the form without amending the form itself. FormTrap's special Substitution facility permits you to insert information from external files onto the output form. Using Substitution, the one FormTrap Load File (.asc) can be used for a number of different organizations - with their specific logo and address information contained in external files and inserted during a print run. This is convenient for:

  • Customizing Forms without Rebuilding - where a common form needs different graphics or text, the graphic/text can be replaced without re-designing forms or even requiring FTDesign.
  • Code Interpretation - where a form requires a particular text or graphic to appear based on a code from your incoming data, the value of the data is used to access the graphic or text to be placed on the form. This can be used to translate terms in one language to another - for example units of measure.
  • Personalization and/or Additional Information (constant field) - where a form includes a personalization or other information not supplied from the incoming file data. Company name, logo, address, PO Box, phone and fax numbers etc. are best represented this way and can be shown in various fonts/sizes and locations on many forms, with just the one location to instantly change the details.

More information on Image Substitution

More information on Barcode Substitution

The substitution file is the external file that is opened by FormTrap at run time. Any information in the file will be inserted onto the form using the formatting and alignment applied to the substitution object.

Note: Text files must be stored in Unicode, in Notepad select Save as, Encoding and UTF-8 from the drop down list.

More information on Substitution Location

Top

Constant Text Substitution

To insert a constant substitution text object:

  • Double click on the text object created.
  • On the Definition tab, enter the name of the substitution file into the text box.

    Co-Address: link all

  • Click the Link all... button to link the sample text to the substitution file.
  • In the Link to field dialog box:
    • Check the Substitute from file check box.
    • Select Constant from the Field drop down menu.
    • Leave the remainder blank and select None for Mask as.
  • Field:Constant, Substitute from File, Suffix: .txt
  • Click the OK button.
  • In the example below FormTrap will open add.txt and insert information from the file onto the form using the formatting and alignment applied to the substitution text object.

More information on Substitution Location

Example substitution

Top

Variable Text Substitution

To insert a variable substitution text object:

  • Double click on the text object created.
  • On the Definition tab, enter sample text into the text box. When creating substitution text objects it is best to make the sample text the maximum possible length of the field extracted from the substitution file.
  • Substitution: Co Address
  • Click the Link all... button to link the sample text to the record variable.
  • In the Link to field dialog box:
    • Check the Substitute from file check box.
    • Select the appropriate variable from the Field drop down menu.
    • Enter the prefix of the variable substitution files into Prefix e.g. add-.
    • Enter the extension of the variable substitution files into Suffix e.g. .txt (including the dot).
  • Field: department_code, Substitute from file, prefix: add-, Suffix .txt
  • Click the OK button.
  • In the example below FormTrap will open add-001.txt and insert information from the file onto the form using the formatting and alignment applied to the substitution text object.
  • Note on the File Name: The linked "field" portion of the file name is automatically left and right stripped of spaces
  • Field content (>field<) File Name Accessed
  • > 001< add-001.txt
  • > 001 < add-001.txt
  • >001 < add-001.txt
  • More information on Substitution Location
  • Illustration: Variable substitution

Top