TFORMer SDK - JAVA  7.5
Public Member Functions | List of all members
Job Class Reference

This is the main class of TFORMer SDK for generating output. More...

Public Member Functions

 Job () throws TFormerException
 Job class constructor. More...
 
void dispose () throws TFormerException
 Releases the resources allocated by this instance. More...
 
void print () throws TFormerException
 Prints the Job using the selected FormLayout and the current JobData. More...
 
void printToStream (OutputStream stream) throws TFormerException
 Print the current Job using the selected FormLayout and current JobData. More...
 
void printToStreams (OutputStreamFactory factory) throws TFormerException
 Print the current Job using the selected FormLayout and current JobData. More...
 
void saveXml (String filename) throws TFormerException
 Saves the JobData used for printing a Job as XML file. More...
 

Properties

String getOptions ()
 Return the additional options for printing and output creation. More...
 
void setOptions (String options)
 Sets additional options for printing and output creation. More...
 
String getConfigurationFile ()
 Gets the current configuration file for TFORMer SDK. More...
 
void setConfigurationFile (String sConfigurationFile)
 Sets the current configuration file for TFORMer SDK. More...
 
String getRepositoryName ()
 Gets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. More...
 
void setRepositoryName (String sRepositoryName)
 Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. More...
 
String getProjectName ()
 Gets the name of the Project for printing a Repository-based FormLayout. More...
 
void setProjectName (String sProjectName)
 Sets the name of the Project for printing a Repository-based FormLayout. More...
 
String getFormName ()
 Gets the name of the Repository-based FormLayout for this Job. More...
 
void setFormName (String sFormName)
 Sets the name of the Repository-based FormLayout for this Job. More...
 
String getPrinterName ()
 Gets the type and the name of the output device. More...
 
void setPrinterName (String sPrinterName)
 Sets the name of the output device (file or printer) and the type of the printer (e.g. normal printer, PDF, JPG,....). More...
 
int getNumberOfCopies ()
 Gets the number of copies to be printed. More...
 
void setNumberOfCopies (int numberOfCopies) throws IllegalArgumentException
 Sets the number of copies to be printed. More...
 
String getJobTrayControlName ()
 Gets the name of the JobTrayControl to be used for this Job. More...
 
void setJobTrayControlName (String sJobTrayControlName)
 Sets the name of the JobTrayControl to be used for this Job. More...
 
String getOutputName ()
 Gets the name of the output file or the name of the spool-job (on Microsoft Windows printers). More...
 
void setOutputName (String sOutputName)
 Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers). More...
 
int getFromPage ()
 Gets the first page-number to be printed. More...
 
void setFromPage (int nFromPage)
 Sets the first page-number to be printed. More...
 
int getToPage ()
 Gets the last page-number to be printed. More...
 
void setToPage (int nToPage)
 Sets the last page number to be printed. More...
 
int getStartColumn ()
 
void setStartColumn (int startColumn) throws IllegalArgumentException
 Sets the column-number of the first label to be printed. More...
 
int getStartRow ()
 Gets the row-number of the first label to be printed. More...
 
void setStartRow (int startRow) throws IllegalArgumentException
 Sets the row-number of the first label to be printed. More...
 
String getRecordCopyDataField ()
 Gets the name of the DataField which specifies the number of Record copies. More...
 
void setRecordCopyDataField (String sRecordCopyDataField)
 Sets the name of the DataField which specifies the number of record copies. More...
 
EPrinterType getPrinterType ()
 Gets the type of the generated output. More...
 
void setPrinterType (EPrinterType printerType)
 Sets the type of the generated output. More...
 
JobData getJobData ()
 Gets the JobData for the Job. More...
 
void setJobData (JobData jobData)
 Sets the JobData for the Job. More...
 

Detailed Description

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

Workflow

The basic steps to generate output are as follows:

  1. Select a FormLayout
  2. Create JobData
    JobData is used to pass dynamic data to a Job.
  3. 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, JobDataDataSource
  4. Create a Job
    The Job class is the main class for printing a FormLayout.
  5. Assign the JobData to the Job
    If no JobData is assigned to a Job, the default data for the FormLayout is used. This default data is identical to the data-set which was used for printing or previewing the FormLayout in the last TFORMer Designer session.
  6. 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.
  7. 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.

Constructor & Destructor Documentation

Job ( ) throws TFormerException

Job class constructor.

Initializes a new instance of the Job class.

Member Function Documentation

void dispose ( ) throws TFormerException

Releases the resources allocated by this instance.

In order to release allocated memory call this method always after the use of the instance.

String getConfigurationFile ( )

Gets the current configuration file for TFORMer SDK.

Returns
The configuration file for TFORMer SDK.
See also
TFORMer.XML Configuration File
String getFormName ( )

Gets the name of the Repository-based FormLayout for this Job.

See also
Repository / FormLayout, FormLayout
Returns
The name of the Repository-based FormLayout for this Job.
int getFromPage ( )

Gets the first page-number to be printed.

Returns
The first page-number to be printed.
JobData getJobData ( )

Gets the JobData for the Job.

Returns
The JobData for the Job
See also
JobData, JobDataCsv, JobDataXml, JobDataOdbc, JobDataDataSource, JobDataRecordSet
String getJobTrayControlName ( )

Gets the name of the JobTrayControl to be used for this Job.

Returns
The name of the JobTrayControl to be used for this Job
See also
JobTrayControl
int getNumberOfCopies ( )

Gets the number of copies to be printed.

Returns
The number of copies to be printed
String getOptions ( )

Return the additional options for printing and output creation.

Returns
A string containing name/value pairs with the currently adjusted print options.
See also
Print Options
String getOutputName ( )

Gets the name of the output file or the name of the spool-job (on Microsoft Windows printers).

Returns
The name of the output file or the name of the spool-job (on Microsoft Windows printers).
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
String getPrinterName ( )

Gets the type and the name of the output device.

Returns
The type and name of the output device.
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
EPrinterType getPrinterType ( )

Gets the type of the generated output.

Returns
The type of the generated output.
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
String getProjectName ( )

Gets the name of the Project for printing a Repository-based FormLayout.

See also
Repository / FormLayout
Returns
The name of the Project for printing a Repository-based FormLayout
String getRecordCopyDataField ( )

Gets the name of the DataField which specifies the number of Record copies.

Returns
The name of the DataField which specifies the number of Record copies.
See also
JobData, DataField
String getRepositoryName ( )

Gets the filename of the Repository or the filename of the stand-alone FormLayout for this Job.

Returns
The filename of the Repository or the filename of the stand-alone FormLayout for this Job.
See also
Repository / FormLayout, FormLayout
int getStartColumn ( )

Gets the column-number of the first label to be printed.

Returns
The column-number of the first label to be printed (starting from 0).
int getStartRow ( )

Gets the row-number of the first label to be printed.

Returns
The row-number of the first label to be printed (starting from 0).
int getToPage ( )

Gets the last page-number to be printed.

Returns
The last page-number to be printed.
void print ( ) throws TFormerException

Prints the Job using the selected FormLayout and the current JobData.

See also
Basic Concept / Printing, JobData
void printToStream ( OutputStream  stream) throws TFormerException

Print the current Job using the selected FormLayout and current JobData.

The output is available in the provided output stream. Use printToStreams for bitmaps with multiple pages.

Parameters
streamInstance of the output stream
See also
Basic Concept / Printing, JobData
void printToStreams ( OutputStreamFactory  factory) throws TFormerException

Print the current Job using the selected FormLayout and current JobData.

The output is available via multiple output streams created and closed by the provided OutputStreamFactory. With bitmap printer type (e.g. ImagePng) each page is printed on a separate stream.

Parameters
factoryInstance used to create and close streams when needed
See also
Basic Concept / Printing, JobData
void saveXml ( String  filename) throws TFormerException

Saves the JobData used for printing a Job as XML file.

This function writes the JobData-cache to the specified file using the internal TFORMer format. This file can later be used for JobDataXml.

Parameters
filenameThe name of the output file.
See also
JobData
void setConfigurationFile ( String  sConfigurationFile)

Sets the current configuration file for TFORMer SDK.

Parameters
sConfigurationFilePath and filename of a TFORMer configuration file
See also
TFORMer.XML Configuration File, Passing Files
void setFormName ( String  sFormName)

Sets the name of the Repository-based FormLayout for this Job.

Specifies the name of the FormLayout which is referenced from within a Project of the current Repository.

Parameters
sFormNameThe name of the Repository-based FormLayout for this Job
Note
Do not use this property for a stand-alone FormLayout.
See also
Repository / FormLayout, FormLayout
Note
All cached JobData is discarded.
void setFromPage ( int  nFromPage)

Sets the first page-number to be printed.

Parameters
nFromPageThe first page-number to be printed

Specifies the page number of the first page to be printed. To restore this setting (printing of all pages of the job), execute the following:

job.setFromPage ( 0 );
job.setToPage ( 0 );
void setJobData ( JobData  jobData)

Sets the JobData for the Job.

JobData is used to provide DataField values for printing the FormLayout. Different methods for providing JobData are available (see JobData, JobDataCsv, JobDataXml, JobDataOdbc, JobDataDataSource, JobDataRecordSet).

Parameters
jobDataThe JobData for the Job
See also
JobData, JobDataCsv, JobDataXml, JobDataOdbc, JobDataDataSource, JobDataRecordSet
void setJobTrayControlName ( String  sJobTrayControlName)

Sets the name of the JobTrayControl to be used for this Job.

Specify the JobTrayControl for the current Job. If this property is not set then the Job is generated with the JobTrayControl named _Default_.

Parameters
sJobTrayControlNameThe name of the JobTrayControl to be used for this Job
See also
JobTrayControl
void setNumberOfCopies ( int  numberOfCopies) throws IllegalArgumentException

Sets the number of copies to be printed.

Specifies the number of identical copies produced with one call to print. The default value is 1.

Parameters
numberOfCopiesThe number of copies to be printed
Exceptions
IllegalArgumentExceptionAn error is raised in case of a negative value.
void setOptions ( String  options)

Sets additional options for printing and output creation.

Parameters
optionsThe options are passed as name/value pairs delimited by white-spaces in the form of [OptionName]=[value].
[OptionName] without an additional value is treated as if [OptionName]=true is provided.
no[OptionName] is treated as if [OptionName]=false is provided
See also
Print Options
void setOutputName ( String  sOutputName)

Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers).

Use setOutputName in conjunction with setPrinterType to specify the type and the target of the generated output. setPrinterName overrides the settings of setOutputName and setPrinterType. Refer to Output Format Prefixes for a description of the supported output formats.

Parameters
sOutputNameThe name of the output file or the name of the spool-job (on Microsoft Windows printers)
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
void setPrinterName ( String  sPrinterName)

Sets the name of the output device (file or printer) and the type of the printer (e.g. normal printer, PDF, JPG,....).

The function specifies the output format as well as the target device or target filename. Refer to Output Format Prefixes for a description of the supported output formats.

Parameters
sPrinterNameThe type and name of the output device
Note
This function must be called prior generating output (see print, printToStream or printToStreams).
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
void setPrinterType ( EPrinterType  printerType)

Sets the type of the generated output.

Use setOutputName in conjunction with setPrinterType to specify the type and the target of the generated output. setPrinterName overrides the settings of setOutputName and setPrinterType. Refer to Output Format Prefixes for a description of the supported output formats.

Parameters
printerTypeThe type of the generated output
See also
Output Format Prefixes, setOutputName, setPrinterType, setPrinterName
void setProjectName ( String  sProjectName)

Sets the name of the Project for printing a Repository-based FormLayout.

When using a Repository-based FormLayout use this function to provide the name of the Project. In addition, the name of the FormLayout must be set with Job.setFormName.

Parameters
sProjectNameThe name of the Project for printing a Repository-based FormLayout
Attention
Do not use this property for a stand-alone FormLayout.
See also
Repository / FormLayout
Note
All cached data as well as the actual FormLayout are discarded.
void setRecordCopyDataField ( String  sRecordCopyDataField)

Sets the name of the DataField which specifies the number of record copies.

TFORMer SDK allows you to specify how often one Record of a JobData should be used for printing. This property specifies which DataField specifies the number of copies for each Record of the JobData.

Parameters
sRecordCopyDataFieldThe name of the DataField which holds the number of Record copies
See also
JobData, DataField
void setRepositoryName ( String  sRepositoryName)

Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job.

Parameters
sRepositoryNameThe filename of the Repository or the filename of the stand-alone FormLayout for this Job

Use this method to provide either the filename of the Repository (*.tfr file) or the stand-alone FormLayout (*.tff file). If you are using a Repository you need to specify the Project (Job.setProjectName) and the FormLayout (Job.setFormName) as well.

See also
Repository / FormLayout, FormLayout, Passing Files
Note
When changing the Repository, the Project or the FormLayout all internal cached data is discarded.
void setStartColumn ( int  startColumn) throws IllegalArgumentException

Sets the column-number of the first label to be printed.

Usually TFORMer prints the first label of a label-style report at the first available position of a page (this is the top / left label). This property sets the column number of the first label, the default starting column is 0. To restore the default behavior do the following:

job.setStartRow ( 0 );
job.setStartColumn ( 0 );
Parameters
startColumnThe column-number of the first label to be printed (leftmost column has index 0)
Exceptions
IllegalArgumentExceptionAn error is raised in case of a negative value
See also
setStartRow
void setStartRow ( int  startRow) throws IllegalArgumentException

Sets the row-number of the first label to be printed.

Usually TFORMer prints the first label of a label-style report at the first available position of a page (this is the top / left label). This property sets the row number of the first label, the default starting row is 0.

Parameters
startRowThe row-number of the first label to be printed (topmost row has index 0)
Exceptions
IllegalArgumentExceptionAn error is raised in case of a negative value.
See also
setStartColumn
void setToPage ( int  nToPage)

Sets the last page number to be printed.

Specifies the page number of the last page to be printed.

Parameters
nToPageThe last page number to be printed
See also
setFromPage

© 2006-2017 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Fri Nov 3 2017 07:59:14 for TFORMer SDK - JAVA with doxygen 1.8.9.1