CaptureAsLongText – XpressDox

CaptureAsLongText and InsertFormattedText. The data capture interview will provide a multi-line control into which the data for the data element can be captured: «CaptureAsLongText(PropertyDescription)»

If this long text is included in the document via a simple fillpoint (in the above example: «PropertyDescription»), then any line breaks which the user may have typed, say by pressing ‘Enter’ in the data capture control, will be ignored.

«CaptureAsLongText(PropertyDescription,6)»
In the above example the parameter ‘6’ requests that the data capture control on the form be approximately 6 lines long.

If it is required that the line breaks or other formatting such as bold, underline or italic in the captured data be included in the document, then the command InsertFormattedText must be used:
«InsertFormattedText(Address)»

The above example will permit the user to type the ‘Address’ in as many lines as necessary, and include the ‘Address’ in the document with the lines separated by line breaks.

Different parts of the ‘long text’ can be formatted in the long text control (by the user) as bold, underlined or italic by using the Word shortcut keys for this formatting, namely <Ctrl B>, <Ctrl U> and <Ctrl I>, respectively.

Relevance

If required, the command can be issued without the control becoming visible on the interview unless the value of the data element is required elsewhere in the template.  This is done as follows:

«CaptureAsLongText(Address,4,PendingRelevance)»

More about the interview can be found in the Relevance article.

Note that when using the InsertFormattedText command, it is not necessary to use a CaptureAsLongText command, unless the number of lines in the data capture control is required to be different to the default, in which case the CaptureAsLongText command must appear in the template before the InsertFormattedText command.

Rich and Classic Options

With Version 7.1.1 the Rich option was added. The Rich option will cause a “Rich Text Editor” to be used as the data-capture control on the interview.

«CaptureAsLongText(Address,3,Always,Rich)»

This will cause the data in the Address data element to be kept as HTML, which in turn will cause the InsertFormattedText function to render the HTML correctly into the assembled document.

«CaptureAsLongText(Address,3,Always)» is the same as «CaptureAsLongText(Address,3,Always,Classic)»

InsertFormattedText can be used to render HTML which has been entered external to XpressDox. For example, HTML in a column in a database row.