Repository Access
Access and modify Repositories or stand-alone FormLayouts.
Overview
A Repository is represented by a master file (extension *.tfr) and a subfolder structure on the file system. It references an arbitrary number of user-defined Project objects. These user-defined Projects are used to divide a Repository into logical areas. Each Project is a container which holds DataField definitions, DataSource definitions and references an arbitrary number of FormLayout objects.
The so-called GlobalProject is allocated by default and is used to define DataFields and DataSources which are available for all FormLayouts regardless of their actual Project membership.
Note
In contrast to a stand-alone FormLayout, the GlobalProject of a Repository can not store references to a FormLayout.
Examples
To open a stand-alone FormLayout do the following:
// Connect to a stand-alone FormLayout (extension *.tff)
// Examples are usually installed in
// - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/9/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples
eCode = TFormer_SetRepositoryName (hTForm, "C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff");
To open a Repository do the following:
// Connect to a Repository (extension *.tfr)
// Examples are usually installed in
// - Windows Vista: C:/Program Data/TEC-IT/TFORMer/9/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples
eCode = TFormer_SetRepositoryName (hTForm, "C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples/Demo Repository/Demos.tfr");
| Name | Kind | Purpose |
|---|---|---|
| EFieldEditMode | enum | Defines the edit mode of a DataField. |
| EFieldInitialValueSource | enum | Defines how the initial value of a DataField is determined. |
| TFormer_AddNewProject | function | Creates and adds a new Project to the Repository. |
| TFormer_DeleteProject | function | Deletes a Project from the Repository. |
| TFormer_AddNewForm | function | Adds a new Form to the given Project. |
| TFormer_DeleteForm | function | Deletes a FormLayout from the specified Project. |
| TFormer_AddNewVar | function | Adds a new DataField to the specified Project. |
| TFormer_DeleteVar | function | Deletes a DataField from the specified Project. |
| TFormer_GetFirstProjectIt | function | Creates a new iterator and sets its position to the first Project within the Repository. |
| TFormer_GetNextProjectIt | function | Moves the iterator to the next Project within the Repository. |
| TFormer_ProjectItGetName | function | Returns the name of the Project the iterator is pointing to. |
| TFormer_ProjectItGetDescription | function | Returns the description of the Project the iterator is pointing to. |
| TFormer_FreeProjectIt | function | Releases the Project iterator and frees any resources associated with it. |
| TFormer_GetFirstFormIt | function | Returns an iterator pointing to the first FormLayout in the specified Project. |
| TFormer_GetNextFormIt | function | Move the iterator to the next FormLayout within the Project. |
| TFormer_FormItGetName | function | Returns the name of the FormLayout the iterator is pointing to. |
| TFormer_FormItGetDescription | function | Returns the description of the FormLayout the iterator is pointing to. |
| TFormer_FreeFormIt | function | Releases the FormLayout iterator and frees any resources associated with it. |
| TFormer_GetFirstProjectVarIt | function | Returns an iterator pointing to the first DataField in the specified Project. |
| TFormer_GetNextProjectVarIt | function | Move the iterator to the next DataField within the Project. |
| TFormer_ProjectVarItGetDetails | function | Returns the details of DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetName | function | Returns the name of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetDescription | function | Returns the description of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetComment | function | Returns the comment of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetCaption | function | Returns the caption of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetDisplayOrder | function | Returns the display-order of the DataField the iterator is pointing to. |
| TFormer_FreeProjectVarIt | function | Releases the DataField iterator and frees any resources associated with it. |
| TFormer_ProjectVarItGetDefValue | function | Returns the default-value of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetType | function | Returns the data-type of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetEditMode | function | Returns the edit mode of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetInitialValueSource | function | Returns the initial value source of the DataField the iterator is pointing to. |
| TFormer_ProjectVarItGetUsage | function | Returns the usage of the DataField specified by an iterator. |
| TFormer_GetVarUsage | function | Retrieves the usage of the DataField specified by its name. |
| TFormer_GetFirstDatasourceIt | function | Returns an iterator pointing to the first DataSource in the specified Project. |
| TFormer_GetNextDatasourceIt | function | Move the iterator to the next DataSource within the Project. |
| TFormer_DatasourceItGetName | function | Returns the name of the DataSource the iterator is pointing to. |
| TFormer_DatasourceItGetDescription | function | Returns the description of the DataSource the iterator is pointing to. |
| TFormer_FreeDatasourceIt | function | Releases the DataSource iterator and frees any resources associated with it. |
| TFormer_GetFirstDSParameterIt | function | Returns an iterator pointing to the first DataSourceParameter of the specified DataSource in the specified Project. |
| TFormer_GetNextDSParameterIt | function | Move the iterator to the next DataSourceParameter within the DataSource. |
| TFormer_DSParameterItGetName | function | Returns the name of the DataSourceParameter the iterator is pointing to. |
| TFormer_DSParameterItGetDescription | function | Returns the description of the DataSourceParameter the iterator is pointing to. |
| TFormer_DSParameterItGetCaption | function | Returns the caption of the DataSourceParameter the iterator is pointing to. |
| TFormer_DSParameterItGetDisplayOrder | function | Returns the display-order of the DataSourceParameter the iterator is pointing to. |
| TFormer_DSParameterItGetDefValue | function | Returns the default-value of the DataSourceParameter the iterator is pointing to. |
| TFormer_FreeDSParameterIt | function | Releases the DataSourceParameter iterator and frees any resources associated with it. |
EFieldEditMode
enum EFieldEditMode
Defines the edit mode of a DataField.
Controls whether and under which conditions a DataField can be edited by the user in combination with a DataSource. This property is configured in TFORMer Designer to be evaluated by external programs. The TFORMer SDK provides read access only.
| Name | Initializer | Description |
|---|---|---|
eFieldEditMode_Default | = 0 | No special handling. Uses the default edit behavior defined by the data source. |
eFieldEditMode_ReadOnly | | The DataField is read-only and cannot be edited by the user. |
eFieldEditMode_Editable | | The DataField is always editable by the user, regardless of the data source. |
eFieldEditMode_EditableIfEmpty | | The DataField is editable only if its current value is empty. |
eFieldEditMode_EditableIfValidationFails | | The DataField is editable only if the current value does not satisfy the validation rule. |
eFieldEditMode_Invalid | | Invalid, internal use only. |
EFieldInitialValueSource
enum EFieldInitialValueSource
Defines how the initial value of a DataField is determined.
Specifies the source from which the initial value of a DataField is populated when a record is loaded (e.g. from the DataSource, from the configured default value, or from the last value entered by the user). This property is configured in TFORMer Designer to be evaluated by external programs. The TFORMer SDK provides read access only.
| Name | Initializer | Description |
|---|---|---|
eFieldInitialValSrc_Default | = 0 | Default behavior. The initial value is determined by the standard rules. |
eFieldInitialValSrc_DefaultIfEmpty | | Use the configured default value only if the current field value is empty. |
eFieldInitialValSrc_DataSource | | Use the value provided by the data source. |
eFieldInitialValSrc_LastValue | | Use the last value entered by the user via the input mask. |
eFieldInitialValSrc_Invalid | | Invalid, internal use only. |