Job class
Namespace: TECIT.TFORMer
Usage and notes
This is the main class of TFORMer SDK for generating output.
Overview
Printing (or more general: producing output) is done with the help of a so-called Job. A Job prints a stand-alone or Repository based FormLayout with dynamic data provided by JobData.
A Job provides various methods for controlling the output behavior. Among other functions it is possible
to select the target device and the required output format (Printing and Export),
set Job options (Print Options),
and to select a specific configuration file (TFORMer.XML Configuration File).
Workflow
The basic steps to generate output are as follows:
Select a FormLayout
Create JobData
JobData is used to pass dynamic data to a Job.
Provide data
Supply values for the data fields used by the selected form layout:From code: use JobDataRecordSet.
From CSV, XML or an ODBC database: use JobDataCsv, JobDataXml or JobDataOdbc.
From a data source defined in the layout: use JobDataDataSource.
Create a Job
The Job class is the main class for printing a FormLayout.Assign the JobData to the Job
If no JobData is assigned to a new Job, TFORMer SDK uses the DataSource selected in the FormLayout. If no source is selected, or the special_Default_source is selected, it uses the saved data in the layout's companion .xml file. See JobDataDataSource.Adjust the properties of the Job
The most important properties are the output-type and the name of the target device (OutputName, PrinterType or PrinterName).
The order in which the properties are set is irrelevant.Print the Job
To generate the Job based on the FormLayout and JobData in the required output format use one of the print-methods (Print, PrintToStream, PrintToStreams) provided by a Job.
More Information
Note
Thread-safety: A single instance of this class must not be used by different threads.
Inheritance and related types
Base types: IDisposable
Constructors
Properties
| Member | Description |
|---|---|
| ConfigFile | Gets/Sets the current configuration file for TFORMer SDK. |
| FormName | Gets/Sets the name of the Repository-based FormLayout for this Job. |
| FromPage | Gets/Sets the first page-number to be printed. |
| JobData | |
| JobTrayControlName | Gets/Sets the name of the JobTrayControl to be used for this Job. |
| NumberOfCopies | Gets/Sets the number of copies to be printed. |
| Options | Gets/Sets additional options for printing and output creation. |
| OutputName | Gets/Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers). |
| PrinterName | Gets/Sets the name of the output device (file or printer). |
| PrinterType | Gets/Sets the type of the generated output. |
| PrintResultType | Gets/Sets the type of data that should be gathered, while printing. |
| ProjectName | Gets/Sets the name of the Project for printing a Repository-based FormLayout. |
| RepositoryName | Gets/Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. |
| StartColumn | Gets/Sets the column-number of the first label to be printed. |
| StartRow | Gets/Sets the row-number of the first label to be printed. |
| ToPage | Gets/Sets the last page number to be printed. |
Methods
| Member | Description |
|---|---|
| Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| GetPrintResult(DataFormat) | Gets the data of the last print operation in specified format. |
| Print() | Prints the Job using the selected FormLayout and the current JobData. |
| PrintToStream(Stream) | Print the current Job using the selected FormLayout and current JobData. |
| PrintToStreams(CreateStreamDelegate, CloseStreamDelegate) | Print the current Job using the selected FormLayout and current JobData. |
| SaveXml(string) |
Delegates
| Member | Description |
|---|---|
| CloseStreamDelegate(Stream) | Delegate used by PrintToStreams to close a stream. |
| CreateStreamDelegate(string) | Delegate used by PrintToStreams to create a new output stream. |