Skip to main content
Skip table of contents

p$TDV:SMPAPI:EtTxRtf


p$TDV:SMPAPI:EtTxRtf

Insert a text from a database table into the current end of the text document.

The text can be saved as an RTF-format (Rich Text Format) file, but also unformatted "normal" texts are possible.

Please note: The longer descriptions and texts that are directly contained in SalesManager are usually RTF-texts.

The data field (RTF-text or normal texts) can be read from any SalesManager or user database table that is available in SalesManager. Also see the data exchange with user databases using SalesManager

However, it is prerequisite for the data access that the dataset with the intended text can be identified via an unambiguous numerical key so that it can be found using the parameters table, IDColumnName and ObjectID.

For the shopping cart positions and the texts that can be deposited in the product catalog it can be checked if such a text is available in the according language using the functions p$TDV:SMPAPI:WkTx_LTX or p$TDV:SMPAPI:WkTx_LTS.

The text itself is then found in this dataset in the database array defined through array name. It can now be directly inserted in the output document by transferring an empty string (’’, not EMPTY) as the parameter value. The formatting of an RTF-text (tabulators, etc.) is adopted, only the page layout is adopted from the main document.

Additionally, the text formatting can also be defined using a special text component which is transferred in Component (without path description or file extension), e.g. if the text is to be indented. In order to position the text, the text component must contain an field function INSERTTEXT. As a document in this case the field function DOCVARIABLE has to be used with the variable name RTFFILE. This array then is substituted by the text from the database.

Tip:

A second option to achieve a special indent for the RTF-text is to insert a table first using the p$TDV:SMPAPI:EtTxTab function and then format this (see there). Then the RTF-text is inserted into the first table cell upon calling the function using " component=’’ ".

The text inserted using this function may not contain any cells of type DocVariable.

Syntax:

p$TDV:SMPAPI:EtTxRtf( ObjectID, IDArrayName, Table, ArrayName, Component )

 

Argument

Type

Meaning

 

ObjectID

Integer

Identification number of the dataset in the database containing the text (key value)

 

IDColumnName

String

Name of the Column in the database table for which the key value in the ObjectID is used

 

Table

String

Name of the database table

 

Columnname

String

Column name of the database table containing the text.

 

Component

String

' ' for direct insertion of the RTF-file

File name if the RTF-file is to be inserted directly using the field function {EINFÜGENTEXT {DOCVARIABLE RTFDATEI} }.

Result:

-

 

Example:

Insert a text from the SalesManager table TM_Texte. The data set is identified by the ID number 4711 (array name of the key in the database is TextID):

p$TDV:SMPAPI:EtTxRtf( 4711, 'TextID', 'TM_Texte', 'MemoText', '' )

 

Also see p$TDV:SMPAPI:WkTx_LTX example.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.