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

Provides access to a user-defined DataSource, which is defined in the FormLayout or a Repository. More...

Public Member Functions

 JobDataDataSource ()
 Constructor for JobDataDataSource. More...
 
 JobDataDataSource (String sName)
 Constructor for JobDataDataSource. More...
 
String getName ()
 Gets the name of the datasource. More...
 
boolean isHandleEscapeSequences ()
 Gets/Sets a flag indicating whether escape sequences in DataField values like \n or \x40 should be translated by TFORMer SDK. More...
 
boolean isReuseValues ()
 Gets a flag indicating whether DataField-values should be reused in consecutive records. More...
 
void setHandleEscapeSequences (boolean bHandleEscapeSequences)
 Sets a flag indicating whether escape sequences like \n or \x40 should be translated by TFORMer. More...
 
void setName (String sName)
 Sets the name of the datasource. More...
 
void setParameterValues (String sParameter, String sValue)
 Sets the values for DataSourceParameters. More...
 
void setReuseValues (boolean bReuseValues)
 Sets a flag indicating whether DataField values should be reused in consecutive Records. More...
 

Detailed Description

Provides access to a user-defined DataSource, which is defined in the FormLayout or a Repository.

Overview

The JobDataDataSource enables TFORMer SDK to use a DataSource defined as part of a FormLayout as JobData for printing a Job.

The creator of a FormLayout is able to define such a DataSource with TFORMer Designer. This DataSource definition is stored as part of the FormLayout and is identified by a unique name. It defines how data is retrieved (e.g. from an ODBC database), the field-mappings and optional DataSourceParameters.

If you specify no or an empty name when using the JobDataDataSource, TFORMer SDK uses the default DataSource specified in the FormLayout. The default JobDataDataSource stores the DataField values used during the last TFORMer Designer session (for this purpose TFORMer Designer maintains an extra file with the extension .xml). If no file with default data exists TFORMer SDK produces no output.

The optional DataSourceParameters may be used to control certain aspects of the JobDataDataSource (like file names, SQL SELECT statement or an ODBC-DSN) during runtime.

Examples

Sample tff has no datasource (remove Sample?) move it to samples ?

The following sample will use a predefined DataSource. Set one DataSourceParameter and send the output to the default printer.

// Create a new Job instance
Job printJob = new Job();
// Select the stand-alone FormLayout named (6) Samples_Picking List.tff
// This FormLayout is usually installed as part of TFORMer in
// - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/7.5/Templates
// - Older versions of Microsoft Windows: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Templates
printJob.setRepositoryName ("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Templates/(6) Samples_Picking List.tff");
// Create a new JobData instance using the DataSource named "ODBC" defined inside the Formlayout
JobDataDataSource jobData = new JobDataDataSource("ODBC");
// Specify any DataSourceParameters
jobData.setParameterValues ("PickingListParameter", "2");
// Assign the JobData to the Job
printJob.setJobData (jobData);
// Select PDF output to /temp/out.pdf
printJob.setOutputName ("/temp/out.pdf");
printJob.setPrinterType (EPrinterType.PDFFile);
// Generate output based on the FormLayout and the JobData
printJob.print();

More Information

For a general description see JobData.

Note
Thread-safety: A single instance of this class must not be used by different threads.

Constructor & Destructor Documentation

Constructor for JobDataDataSource.

Initializes a new instance of JobDataDataSource class.

JobDataDataSource ( String  sName)

Constructor for JobDataDataSource.

Initializes a new instance of JobDataDataSource class.

Parameters
sNameThe name of the DataSource in the FormLayout or in the Repository
See also
JobData, JobDataDataSource, DataSource

Member Function Documentation

String getName ( )

Gets the name of the datasource.

Returns
The name of the DataSource in the FormLayout or in the Repository
See also
JobData, JobDataDataSource, DataSource
boolean isHandleEscapeSequences ( )
inherited

Gets/Sets a flag indicating whether escape sequences in DataField values like \n or \x40 should be translated by TFORMer SDK.

Returns
true if escape sequences in DataField values are translated
See also
JobData, Escape Sequences
boolean isReuseValues ( )
inherited

Gets a flag indicating whether DataField-values should be reused in consecutive records.

Returns
false if DataField-values are cleared between records
See also
JobData
void setHandleEscapeSequences ( boolean  bHandleEscapeSequences)
inherited

Sets a flag indicating whether escape sequences like \n or \x40 should be translated by TFORMer.

Parameters
bHandleEscapeSequencestrue if escape sequences in DataField-values should be translated
See also
JobData, Escape Sequences
void setName ( String  sName)

Sets the name of the datasource.

If no name or an empty string was specified, then TFORMer SDK uses the default DataSource.

Parameters
sNameThe name of the DataSource in the FormLayout or in the Repository
See also
JobData, JobDataDataSource, DataSource
void setParameterValues ( String  sParameter,
String  sValue 
)

Sets the values for DataSourceParameters.

Parameters
sParameterThe name of the DataSourceParameter
sValueThe value of the DataSourceParameter
See also
JobDataDataSource, DataSource, DataSourceParameter
void setReuseValues ( boolean  bReuseValues)
inherited

Sets a flag indicating whether DataField values should be reused in consecutive Records.

Parameters
bReuseValuesfalse if DataField-values should be cleared between Records
See also
JobData, DataField

© 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