Job class
Package: com.tecit.TFORMer.Printing
This is the main class of TFORMer SDK for generating output.
Usage and notes
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 for JobData
The JobData is use to provide values for the DataFields required for the FormLayout to be printed.
Provide data programmatically or instruct JobData to use a DataSource already defined in the FormLayout (e.g. importing data from a CSV file or a ODBC database). See JobDataRecordSet, JobDataCsv, JobDataOdbc, JobDataXml, JobDataDataSourceCreate 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 (setOutputName, setPrinterType or setPrinterName).
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.
Constructors
Methods
| Member | Description |
|---|---|
| dispose() | Releases the resources allocated by this instance. |
| getConfigurationFile() | Gets the current configuration file for TFORMer SDK. |
| getFormName() | Gets the name of the Repository-based FormLayout for this Job. |
| getFromPage() | Gets the first page-number to be printed. |
| getJobData() | |
| getJobTrayControlName() | Gets the name of the JobTrayControl to be used for this Job. |
| getNumberOfCopies() | Gets the number of copies to be printed. |
| getOptions() | Return the additional options for printing and output creation. |
| getOutputName() | Gets the name of the output file or the name of the spool-job (on Microsoft Windows printers). |
| getPrinterName() | Gets the type and the name of the output device. |
| getPrinterType() | Gets the type of the generated output. |
| getPrintResult(DataFormat) | Gets the data of the last print operation in specified format. |
| getPrintResultType() | Gets the type of data that should be gathered, while printing. |
| getProjectName() | Gets the name of the Project for printing a Repository-based FormLayout. |
| getRepositoryName() | Gets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. |
| getStartColumn() | |
| getStartRow() | Gets the row-number of the first label to be printed. |
| getToPage() | Gets the last page-number to be printed. |
| print() | Prints the Job using the selected FormLayout and the current JobData. |
| printToStream(OutputStream) | Print the current Job using the selected FormLayout and current JobData. |
| printToStreams(OutputStreamFactory) | Print the current Job using the selected FormLayout and current JobData. |
| saveXml(String) | |
| setConfigurationFile(String) | Sets the current configuration file for TFORMer SDK. |
| setFormName(String) | Sets the name of the Repository-based FormLayout for this Job. |
| setFromPage(int) | Sets the first page-number to be printed. |
| setJobData(JobData) | |
| setJobTrayControlName(String) | Sets the name of the JobTrayControl to be used for this Job. |
| setNumberOfCopies(int) | Sets the number of copies to be printed. |
| setOptions(String) | Sets additional options for printing and output creation. |
| setOutputName(String) | Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers). |
| setPrinterName(String) | Sets the name of the output device (file or printer). |
| setPrinterType(EPrinterType) | Sets the type of the generated output. |
| setPrintResultType(PrintResultType) | Sets the type of data that should be gathered, while printing. |
| setProjectName(String) | Sets the name of the Project for printing a Repository-based FormLayout. |
| setRepositoryName(String) | Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. |
| setStartColumn(int) | Sets the column-number of the first label to be printed. |
| setStartRow(int) | Sets the row-number of the first label to be printed. |
| setToPage(int) | Sets the last page number to be printed. |