TFORMer SDK - NET  8
Public Member Functions | Properties
Job Class Reference

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

List of all members.

Public Member Functions

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

Properties

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

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 class constructor.

Initializes a new instance of the Job class.


Member Function Documentation

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
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
void Dispose ( )

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

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
void Print ( )

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

See also:
Basic Concept / Printing, JobData
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
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
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

string ConfigFile [get, set]

Gets/Sets the current configuration file for TFORMer SDK.

Returns:
The configuration file for TFORMer SDK.
See also:
TFORMer.XML Configuration File, Passing Files
string FormName [get, set]

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.
int FromPage [get, set]

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 [get, set]

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
string JobTrayControlName [get, set]

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
int NumberOfCopies [get, set]

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
String Options [get, set]

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
string OutputName [get, set]

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
string PrinterName [get, set]

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

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

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
string ProjectName [get, set]

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.
string RepositoryName [get, set]

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.
int StartColumn [get, set]

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)
int StartRow [get, set]

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
int ToPage [get, set]

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-2024 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Aug 7 2024 17:29:42 for TFORMer SDK - NET with doxygen 1.7.6.1