General Syntax - Fields

<< Click to Display Table of Contents >>

Navigation:  Programming > WPReporter > Token to Template Conversion >

General Syntax - Fields

The  token to template conversion uses special character combinations to separate the commands from the text. Fields have to be embedded into the characters << and >>.

 

(This codes <<, >>, : and # can be customized in TWPFieldBandSyntax for syntax highlighting.  Other values can be passed to the method WPConvertReportScript)

 

Note:

 

The parser expects that after the << and before the >> characters no whitespace characters are typed. Otherwise the characters will be interpreted as text.

 

Example for fields:

 

<<name>>

 

The name of a field may contain space characters.

 

Optionally the closing '/' character can be printed:

 

<<name/>>

 

Using such fields mail merge documents can be created. Such merge documents only require fields to be filled with data. Using mail merge does not require the reporting extension so we decided to make the syntax highlighting and token to template conversion available in the basis edition.

 

If you need repeated data rows in a document you need groups and bands. Bands mark certain text to be the header and footer of a document or group while groups are used to loop certain parts of the template as long as data to fill in the fields is available. Groups can also be used to disable certain parts of the template. While bands are not nested, groups can be nested and so consist of a start and end token.

 

Note: The name of a field will be passed to the event WPRichText.OnMailMergGetText or WPSuperMerge.OnMailMergeGetTextwhile merging the text or creating a report. This event can retrieve the text which should be inserted inside the field.