IJobData interface
Library: TFORMer9Lib
Abstract base class for JobData.
Usage and notes
JobData
Overview
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:
Importing data using JobDataCsv, JobDataXml or JobDataOdbc.
Each of these connects to the specified file or database and reads the data Record by Record.Provide the data via code using JobDataRecordSet.
This is the preferred method for passing data to TFORMer SDK from within an application. The JobDataRecordSet is constructed in memory and filled with an arbitrary number of records. Each Record contains pairs of DataField-names/DataField-values.A JobDataDataSource defined by the user in the FormLayout.
Such a DataSource defines how data is retrieved (e.g. from an ODBC database), the field-mappings (see DSFieldMapping) and optional parameters (see DataSourceParameter).
Data Processing
JobData is processed record by record in the order supplied. Record processing and the need for new pages trigger the bands defined in the FormLayout:
Report headers are processed at the start of the output, after the first record has been read.
Detail bands are normally processed for each record.
Group headers and footers are processed at group boundaries determined by the layout's Group By values.
Page headers and footers are processed as pages begin and end.
Report footers are processed after the last record.
Printing conditions and layout settings determine which bands are actually printed and where they appear.
Note
TFORMer requires at least one Record to produce output.
Escape Sequences
It depends on HandleEscapeSequences whether possible escape sequences in the values are translated into their corresponding binary representation. See Escape Sequences for details.
Record Copies
Each Record of a DataSource is usually considered exactly once for generating output. Use DataSource.CopyColumnName 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).
Unknown DataFields in JobData
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 JobDataRecordSet you have to set the option ignore-undefined-fields.
Missing DataFields in JobData
If a DataField, which is used in the FormLayout, is not present in the JobData its value depends on JobData.ReuseValues. if JobData.ReuseValues is set to
truethen 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 DataFieldType) between records.
Note
DataFields which are computed with post- or pre-evaluations within a FormLayout will not be cleared (see DataFieldUsage).
Missing JobData
If no JobData is specified for a new Job, TFORMer SDK uses the DataSource selected in the FormLayout. This need not be the special _Default_ source.
The _Default_ source reads the DataField values saved by TFORMer Designer alongside the layout in its companion .xml file. The SDK also falls back to that file when no source is selected in the layout. When this companion file supplies the input, it must contain at least one record to produce output.
Note
An empty JobDataRecordSet does not guarantee empty output. If your application has no records to print, skip the print call.
Identifying the Required DataFields
To iterate through the DataFields of a Project, start with Project.FirstDataField and continue with DataField.Next. Use FormLayout.GetDataFieldUsage to check whether each DataField is used in a particular FormLayout.
More Information
JobDataRecordSet
In-memory DataSourceJobDataCsv
CSV importJobDataXml
XML importJobDataOdbc
ODBC connectivityJobDataDataSource
User-defined DataSource JobData
Note
Thread-safety: A single instance of this class must not be used by different threads.
Inheritance and related types
Base types: IDispatch
Derived types: IJobDataCsv, IJobDataDataSource, IJobDataOdbc, IJobDataRecordSet, IJobDataXml
Properties
| Member | Description |
|---|---|
| HandleEscapeSequences | Gets/Sets a flag indicating whether escape sequences in DataField values like \n or \x40 should be translated by TFORMer SDK. |
| ReuseValues | Gets/Sets a flag indicating whether DataField values should be reused in consecutive Records. |