TFORMer SDK - NET 8
Public Member Functions | Properties | List of all members
Job Class Reference

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

Public Member Functions

 Job ()
 Job class constructor. More...
 
delegate void CloseStreamDelegate (Stream stream)
 Delegate used by PrintToStreams to close a stream. More...
 
delegate Stream CreateStreamDelegate (string sStreamObjName)
 Delegate used by PrintToStreams to create a new output stream. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
string GetPrintResult (DataFormat dataFormat)
 Gets the data of the last print operation in specified format. More...
 
void Print ()
 Prints the Job using the selected FormLayout and the current JobData. More...
 
void PrintToStream (Stream stream)
 Print the current Job using the selected FormLayout and current JobData. More...
 
void PrintToStreams (CreateStreamDelegate fnCreate, CloseStreamDelegate fnClose)
 Print the current Job using the selected FormLayout and current JobData. More...
 
virtual void SaveXml (string filename)
 Saves the JobData used for printing a Job as XML file. More...
 

Properties

string ConfigFile [get, set]
 Gets/Sets the current configuration file for TFORMer SDK. More...
 
string FormName [get, set]
 Gets/Sets the name of the Repository-based FormLayout for this Job. More...
 
int FromPage [get, set]
 Gets/Sets the first page-number to be printed. More...
 
JobData JobData [get, set]
 Gets/Sets the JobData for the Job. More...
 
string JobTrayControlName [get, set]
 Gets/Sets the name of the JobTrayControl to be used for this Job. More...
 
int NumberOfCopies [get, set]
 Gets/Sets the number of copies to be printed. More...
 
String Options [get, set]
 Gets/Sets additional options for printing and output creation. More...
 
string OutputName [get, set]
 Gets/Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers). More...
 
string PrinterName [get, set]
 Gets/Sets the name of the output device (file or printer) and the type of the printer (e.g. More...
 
PrinterType PrinterType [get, set]
 Gets/Sets the type of the generated output. More...
 
PrintResultType PrintResultType [get, set]
 Gets/Sets the type of data that should be gathered, while printing. More...
 
string ProjectName [get, set]
 Gets/Sets the name of the Project for printing a Repository-based FormLayout. More...
 
string RepositoryName [get, set]
 Gets/Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. More...
 
int StartColumn [get, set]
 Gets/Sets the column-number of the first label to be printed. More...
 
int StartRow [get, set]
 Gets/Sets the row-number of the first label to be printed. More...
 
int ToPage [get, set]
 Gets/Sets the last page number to be printed. 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 (OutputName, PrinterType or PrinterName).
    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()

Job ( )

Job class constructor.

Initializes a new instance of the Job class.

Member Function Documentation

◆ CloseStreamDelegate()

delegate void CloseStreamDelegate ( Stream  stream)

Delegate used by PrintToStreams to close a stream.

This delegate is called when the current stream should be closed. The delegate will only be triggered while inside PrintToStreams.

Parameters
streamStream to be closed
See also
Basic Concept / Printing, PrintToStreams

◆ CreateStreamDelegate()

delegate Stream CreateStreamDelegate ( string  sStreamObjName)

Delegate used by PrintToStreams to create a new output stream.

This delegate is called when a new stream should be created. The delegate will only be triggered while inside PrintToStreams. If the output format needs several streams (e.g. multi-page BMP output), this event will be triggered for each single stream (in this case for each page).

Parameters
sStreamObjNameName of the stream, the name of the stream contains information about out type, output file name (in case of a file stream) and the stream counter
See also
Basic Concept / Printing, PrintToStreams

◆ Dispose()

void Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ GetPrintResult()

string GetPrintResult ( DataFormat  dataFormat)

Gets the data of the last print operation in specified format.

Call this function after Print or PrintToStreams to get the data that has been gathered while printing. Specify the data to be gathered by a call to PrintResultType before Print or PrintToStreams.

Returns
The data that has been gathered while printing. This returned value is only valid if peCode is ErrOk (0).
Parameters
dataFormatFlags for format of generated data.
See also
PrintResultType

◆ Print()

void Print ( )

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

See also
Basic Concept / Printing, JobData

◆ PrintToStream()

void PrintToStream ( Stream  stream)

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

The output is available in the provided output stream.

Parameters
streamOutput stream
See also
Basic Concept / Printing, JobData

◆ PrintToStreams()

void PrintToStreams ( CreateStreamDelegate  fnCreate,
CloseStreamDelegate  fnClose 
)

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

The output is provided via multiple output streams created and closed by the provided delegates.

Parameters
fnCreateDelegate function to create a new stream
fnCloseDelegate function to close a stream
See also
Basic Concept / Printing

◆ SaveXml()

virtual void SaveXml ( string  filename)
virtual

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

Property Documentation

◆ ConfigFile

string ConfigFile
getset

Gets/Sets the current configuration file for TFORMer SDK.

Returns
The configuration file for TFORMer SDK.
See also
TFORMer.XML Configuration File, Passing Files

◆ FormName

string FormName
getset

Gets/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.

Returns
The 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.

◆ FromPage

int FromPage
getset

Gets/Sets the first page-number to be printed.

Returns
The 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.FromPage = 0;
job.ToPage = 0;

◆ JobData

JobData JobData
getset

Gets/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).

Returns
The JobData for the Job
See also
JobData, JobDataCsv, JobDataXml, JobDataOdbc, JobDataDataSource, JobDataRecordSet

◆ JobTrayControlName

string JobTrayControlName
getset

Gets/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.

Returns
The name of the JobTrayControl to be used for this Job
See also
JobTrayControl

◆ NumberOfCopies

int NumberOfCopies
getset

Gets/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.

Returns
The number of copies to be printed

◆ Options

String Options
getset

Gets/Sets additional options for printing and output creation.

Returns
The 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

◆ OutputName

string OutputName
getset

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

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

Returns
The name of the output file or the name of the spool-job (on Microsoft Windows printers)
See also
Output Format Prefixes, OutputName, PrinterType, PrinterName

◆ PrinterName

string PrinterName
getset

Gets/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.

Returns
The 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, OutputName, PrinterType, PrinterName

◆ PrinterType

Gets/Sets the type of the generated output.

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

Returns
The type of the generated output
See also
Output Format Prefixes, OutputName, PrinterType, PrinterName

◆ PrintResultType

Gets/Sets the type of data that should be gathered, while printing.

Call this function before Print or PrintToStreams to specify the data that should be gathered while printing. After the output has been generated the data can retrieved by a call to GetPrintResult.

Returns
The type of data that should be gathered, while printing.
See also
GetPrintResult

◆ ProjectName

string ProjectName
getset

Gets/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.FormName.

Returns
The 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.

◆ RepositoryName

string RepositoryName
getset

Gets/Sets the 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.ProjectName) and the FormLayout (Job.FormName) as well.

Returns
The filename of the Repository or the filename of the stand-alone FormLayout for this Job
See also
Repository / FormLayout, FormLayout, Passing Files
Note
When changing the Repository, the Project or the FormLayout all internal cached data is discarded.

◆ StartColumn

int StartColumn
getset

Gets/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.StartRow = 0;
job.StartColumn = 0;
Returns
The column-number of the first label to be printed (leftmost column has index 0)

◆ StartRow

int StartRow
getset

Gets/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.

Returns
The row-number of the first label to be printed (topmost row has index 0)
See also
StartColumn

◆ ToPage

int ToPage
getset

Gets/Sets the last page number to be printed.

Returns
The last page-number to be printed

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

See also
FromPage

© 2006-2023 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Thu Dec 28 2023 18:45:19 for TFORMer SDK - NET with doxygen 1.9.4