TFORMer SDK - DLL/Library
8
|
TFORMer SDK retrieves data used for printing a Job with the help of JobData. More...
Functions | |
ERRCODE | TFormer_SetDatasourceName (HTFORM pInstance, LPCSTR pszDatasourceName) |
Specifies the name of the user-defined DataSource to be used as JobData. | |
LPCSTR | TFormer_GetDatasourceName (HTFORM pInstance, ERRCODE *peCode) |
Provides the name of the active DataSource of the current FormLayout. | |
ERRCODE | TFormer_SetDSParameterValue (HTFORM pInstance, LPCSTR pszParameterName, LPCSTR pszValue) |
Specifies the value of a DataSourceParameter. | |
ERRCODE | TFormer_SetDataFile (HTFORM pInstance, LPCSTR pszFileName) |
Sets a XML file (in the format used internally by TFORMer) as JobData. | |
ERRCODE | TFormer_ResetData (HTFORM pInstance) |
Resets the data-cache. | |
ERRCODE | TFormer_NewRecord (HTFORM pInstance) |
Appends a new Record to the DataSource. | |
ERRCODE | TFormer_SetRecordCopy (HTFORM pInstance, UINT nRecordCopy) |
Sets the number of copies for the actual Record. | |
ERRCODE | TFormer_SetVarValue (HTFORM pInstance, LPCSTR szVarName, LPCSTR szVarValue) |
Sets the value of a DataField. | |
ERRCODE | TFormer_SetReuseValues (HTFORM pInstance, BOOL bReuse) |
Selects if DataField values should be reused in consecutive Records. | |
ERRCODE | TFormer_SetHandleEscapeSequences (HTFORM pInstance, BOOL bOn) |
Selects whether escape sequences like \n or \x40 should be translated by TFORMer. | |
ERRCODE | TFormer_SetImportFieldForRecordCopy (HTFORM pInstance, LPCSTR pszFieldName, BOOL bIsAttribute) |
Specifies which DataField in the input controls the number of Record copies. | |
ERRCODE | TFormer_SetTxtDataFile (HTFORM pInstance, LPCSTR pszFileName, CHAR cSeparator, CHAR cTextQualifier) |
Specifies a text file (CSV, TSV, ...) as JobData. | |
ERRCODE | TFormer_SetODBCData (HTFORM pInstance, LPCSTR pszDSN, LPCSTR pszUser, LPCSTR pszPwd, LPCSTR pszSQLSelect) |
Specifies an SQL-SELECT statement (ODBC) as JobData. | |
ERRCODE | TFormer_SetXmlDataFile (HTFORM pInstance, LPCSTR pszFileName) |
Specifies a XML file as JobData. | |
ERRCODE | TFormer_SetXmlDataFileEx (HTFORM pInstance, LPCSTR pszFileName, LPCSTR pszXsltFileName, LPCSTR pszXsltTFC) |
Specifies a XML file as JobData and transforms it with the given XSLT. | |
ERRCODE | TFormer_SaveXml (HTFORM pInstance, LPCSTR pszFileName) |
Saves the actual JobData as XML file in the internal TFORMer format. |
TFORMer SDK retrieves data used for printing a Job with the help of JobData.
TFORMer SDK retrieves data used for printing a Job with the help of JobData.
JobData is used to provide values for the DataFields used in a FormLayout.
Different types of JobData classes are supported:
JobData is always iterated Record by Record, the order of the Records is not changed. All DataFields available in a Record are processed.
It depends on TFormer_SetHandleEscapeSequences whether possible escape sequences in the values are translated into their corresponding binary representation. See Escape Sequences for details.
Each Record of a DataSource is usually considered exactly once for generating output. Use TFormer_SetImportFieldForRecordCopy to instruct TFORMer SDK to use a specific field of the DataSource which contains the copy counter. This feature is helpful whenever a single Record of a DataSource should be printed multiple times (e.g. if a certain number of identical labels should be printed).
If the JobData provides more DataFields than defined (either in the stand-alone FormLayout or in the Project of the Repository), these additional fields will be ignored. For a JobDataDataSource you have to set the option ignore-undefined-fields
.
If a DataField, which is used in the FormLayout, is not present in the JobData its value depends on TFormer_SetReuseValues. if TFormer_SetReuseValues is set to
true
then the value of a DataField will be preserved between records. The last value will be reused in consecutive records until a new value is set.false
(which is the default), then all DataFields are set to "" (empty string) or 0 (depending on the TFormer_ProjectVarItGetType) between records.If no (or an empty) JobData was specified then TFORMer SDK uses the default DataSource for printing the Job. The default data is stored in an extra file located in the same directory as the FormLayout itself and is named FormlayoutName.xml
. It contains the DataField values used during the last TFORMer Designer session.
If no file with default data exists TFORMer SDK produces no output.
In order to identify all DataFields in a Project or in a FormLayout use the functions TFormer_GetFirstProjectVarIt and TFormer_GetNextProjectVarIt. If you want to know, whether a returned DataField is actually used in the FormLayout use the function TFormer_ProjectVarItGetUsage.
LPCSTR TFormer_GetDatasourceName | ( | HTFORM | pInstance, |
ERRCODE * | peCode | ||
) |
Provides the name of the active DataSource of the current FormLayout.
Use this function to get the name of the active DataSource of the current FormLayout. If the manual DataSource is the active one, this functions returns an empty string.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
peCode | Error Code, ErrOk (0) in case of success |
ERRCODE TFormer_NewRecord | ( | HTFORM | pInstance | ) |
Appends a new Record to the DataSource.
A Record is a collection of name/value pairs. This pair holds the name of a DataField (first member of the pair) and its value (second member of the pair). Call this function before you set DataField values for the new Record.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
ERRCODE TFormer_ResetData | ( | HTFORM | pInstance | ) |
Resets the data-cache.
All DataFields handed over to TFORMer with TFormer_SetVarValue, TFormer_NewRecord or TFormer_SetDataFile are cached internally. As long as this cache is not deleted with this function the cached values will be used for a Job. Call this method before starting a new Job.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
ERRCODE TFormer_SaveXml | ( | HTFORM | pInstance, |
LPCSTR | pszFileName | ||
) |
Saves the actual JobData as XML file in the internal TFORMer format.
All DataFields set by TFormer_SetTxtDataFile, TFormer_SetXmlDataFile, TFormer_SetODBCData or by TFormer_SetVarValue are cached internally. This function writes the cache to the specified file which can the be used with TFormer_SetDataFile.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFileName | Target filename |
ERRCODE TFormer_SetDataFile | ( | HTFORM | pInstance, |
LPCSTR | pszFileName | ||
) |
Sets a XML file (in the format used internally by TFORMer) as JobData.
The specified file conform to the internal TFORMer format and is created with the function TFormer_SaveXml. Normally this function is not required by users.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFileName | Filename (in internal TFORMer XML format) |
ERRCODE TFormer_SetDatasourceName | ( | HTFORM | pInstance, |
LPCSTR | pszDatasourceName | ||
) |
Specifies the name of the user-defined DataSource to be used as JobData.
Use this function to specify the name of the user-defined DataSource which should be used as JobData for printing.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszDatasourceName | The name of the DataSource as defined in the FormLayout |
ERRCODE TFormer_SetDSParameterValue | ( | HTFORM | pInstance, |
LPCSTR | pszParameterName, | ||
LPCSTR | pszValue | ||
) |
Specifies the value of a DataSourceParameter.
Use this function to specify a value for a DataSourceParameter. A DataSourceParameter may be defined by the user with TFORMer Designer and can be used to control certain aspects of a DataSource during runtime (e.g. filenames, SQL statement or an ODBC-DSN).
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszParameterName | The name of the DataSourceParameter to be set |
pszValue | The value to be set |
ERRCODE TFormer_SetHandleEscapeSequences | ( | HTFORM | pInstance, |
BOOL | bOn | ||
) |
Selects whether escape sequences like \n or \x40 should be translated by TFORMer.
The default value is FALSE
. That means TFORMer uses DataField values exactly as provided, no escape sequence handling will be performed.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
bOn | TRUE if escape sequences should be translated |
ERRCODE TFormer_SetImportFieldForRecordCopy | ( | HTFORM | pInstance, |
LPCSTR | pszFieldName, | ||
BOOL | bIsAttribute | ||
) |
Specifies which DataField in the input controls the number of Record copies.
TFORMer allows you to specify how often one Record of a DataSource should be used for printing (see also TFormer_SetRecordCopy). This functions specifies which DataField holds the number of copies for each Record of the DataSource.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFieldName | The DataField name which holds the Record-copy counter. NULL if none should be used (default: NULL ). |
bIsAttribute | Specifies if the given DataField name is the name of an attribute field. Used only for XML-Imports. |
ERRCODE TFormer_SetODBCData | ( | HTFORM | pInstance, |
LPCSTR | pszDSN, | ||
LPCSTR | pszUser, | ||
LPCSTR | pszPwd, | ||
LPCSTR | pszSQLSelect | ||
) |
Specifies an SQL-SELECT statement (ODBC) as JobData.
The column names returned by the SQL statement must match the DataField names in the FormLayout.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszDSN | DSN of the ODBC connection |
pszUser | User-Name for ODBC connection (may be NULL or an empty string) |
pszPwd | Password for the ODBC connection (may be NULL or an empty string) |
pszSQLSelect | SQL-SELECT statement for retrieving data. |
ERRCODE TFormer_SetRecordCopy | ( | HTFORM | pInstance, |
UINT | nRecordCopy | ||
) |
Sets the number of copies for the actual Record.
The value provided with this function specifies how often this Record is used for printing. May be called after TFormer_NewRecord. If TFormer_SetRecordCopy is not set, then the default value 1 will be used.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
nRecordCopy | The number of copies for the current Record. |
ERRCODE TFormer_SetReuseValues | ( | HTFORM | pInstance, |
BOOL | bReuse | ||
) |
Selects if DataField values should be reused in consecutive Records.
TRUE
, then the value of a DataField will be preserved between Records. FALSE
(which is the default), then all DataFields are set to "" (empty string) or 0 (depending on the DataFieldType) between Records. It is recommended to set all DataFields for each Record.pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
bReuse | Should data be reused for each Record? |
ERRCODE TFormer_SetTxtDataFile | ( | HTFORM | pInstance, |
LPCSTR | pszFileName, | ||
CHAR | cSeparator, | ||
CHAR | cTextQualifier | ||
) |
Specifies a text file (CSV, TSV, ...) as JobData.
The column names used in the text file must match the DataField names in the FormLayout
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFileName | Text/CSV/TSV filename |
cSeparator | DataField separator (e.g. , or ; ) |
cTextQualifier | Text qualifier (e.g. "\'" or " - default is none) |
ERRCODE TFormer_SetVarValue | ( | HTFORM | pInstance, |
LPCSTR | szVarName, | ||
LPCSTR | szVarValue | ||
) |
Sets the value of a DataField.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
szVarName | The name of the DataField for which the value should be set. |
szVarValue | The value for the given DataField. |
If you want to identify the DataFields which are available in a Project or FormLayout, please use the function TFormer_GetFirstProjectVarIt.
ERRCODE TFormer_SetXmlDataFile | ( | HTFORM | pInstance, |
LPCSTR | pszFileName | ||
) |
Specifies a XML file as JobData.
The element (or attribute) names in the XML file must match the DataField names in the FormLayout.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFileName | XML filename |
ERRCODE TFormer_SetXmlDataFileEx | ( | HTFORM | pInstance, |
LPCSTR | pszFileName, | ||
LPCSTR | pszXsltFileName, | ||
LPCSTR | pszXsltTFC | ||
) |
Specifies a XML file as JobData and transforms it with the given XSLT.
This function is similar to TFormer_SetXmlDataFile but transforms the XML file with the specified XSLT before being used as JobData.
pInstance | The TFORMer instance provided by a previous call to TFormer_Init |
pszFileName | XML filename |
pszXsltFileName | XSLT filename, if NULL then no transformation is performed |
pszXsltTFC | XSLT TFC filename. Internal Use ONLY (generates TFC File from given xml file) |
© 2006-2024 - all rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Sat Oct 5 2024 05:08:16 for TFORMer SDK - DLL/Library with doxygen 1.7.6.1 |