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

Provides access to JobDataCsv (a CSV-file that serves as JobData for a Job). More...

Public Member Functions

 JobDataCsv ()
 Constructor for JobDataCsv. More...
 
 JobDataCsv (string filename, char separator, char qualifier)
 Constructor for JobDataCsv. More...
 

Properties

string Filename [get, set]
 Gets/Sets the filename of the CSV file. More...
 
bool HandleEscapeSequences [get, set]
 Gets/Sets a flag indicating whether escape sequences in DataField values like \n or \x40 should be translated by TFORMer SDK. More...
 
char Qualifier [get, set]
 Gets/Sets the qualifier character that encloses DataField values. More...
 
string RecordCopyDataField [get, set]
 Gets/Sets the name of the DataField which specifies the number of Record copies. More...
 
bool ReuseValues [get, set]
 Gets/Sets a flag indicating whether DataField values should be reused in consecutive Records. More...
 
char Separator [get, set]
 Gets/Sets the separator character that separates DataField names or DataField values. More...
 

Detailed Description

Provides access to JobDataCsv (a CSV-file that serves as JobData for a Job).

Overview

The JobDataCsv enables TFORMer SDK to use CSV-files (or more generic: any text file in a suitable format) as JobData for printing a Job.

The data in such a file provides the values of the DataFields. Each line (except the first one - see below) is treated as a Record. TFORMer SDK matches the column names in the file with the corresponding DataField names if the FormLayout. Therefore the first row of the file must contain the DataField names, separated by a separator character. All other rows contain the DataField values, again separated by a separator character. Each value or name of a DataField may be enclosed in optional qualifier characters. This is useful if the separator character may be part of a DataField value.

The default qualifier character is the double quote ("), the default separator character is the comma (,). If the file uses no qualifiers, set the qualifier to '\0'.

Example

The following example file contains 2 records. The first line lists the DataField-names. The comma (,) is used as separator character and the double quote (") is used as qualifier character:

"Email","JobTitle","Name"
"support@tec-it.com","Support Engineer","Mr. Harald Backoffice"
"sales@tec-it.com","Sales Assistant","Mrs. Susan Frontdesk"

Assume the sample file specified above is stored in C:/temp/Import.txt. The corresponding call to create the JobData and to assign it to a Job is as follows: MISSING tff file that matches the given csv datafields, samples to be adopted too ****

// Create a new Job instance
Job printJob = new Job();
// Select the FormLayout (stand-alone or Repository-based)
// ...
// Create a new JobData instance
// Here we import a CSV and specify separator and qualifier character
JobDataCsv jobData = new JobDataCsv("/temp/Import.txt", ',', '"');
// Assign the JobData to the Job
printJob.JobData = jobData;
// Select PDF output to /temp/out.pdf
printJob.OutputName = "/temp/out.pdf";
printJob.PrinterType = PrinterType.PdfFile;
// Generate output based on the FormLayout and the JobData
printJob.Print ();
Provides access to JobDataCsv (a CSV-file that serves as JobData for a Job).
Definition: JobDataCsv.cs:20
JobDataCsv()
Constructor for JobDataCsv.
Definition: JobDataCsv.cs:34
This is the main class of TFORMer SDK for generating output.
Definition: Job.cs:266
PrinterType
This enumeration specifies the type of output generated by TFORMer SDK.
Definition: Job.cs:26

More Information

For a general description see JobData.

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

Constructor & Destructor Documentation

◆ JobDataCsv() [1/2]

Constructor for JobDataCsv.

Initializes a new instance of the JobDataCsv class.

See also
JobDataCsv

◆ JobDataCsv() [2/2]

JobDataCsv ( string  filename,
char  separator,
char  qualifier 
)

Constructor for JobDataCsv.

Initializes a new instance of the JobDataCsv class.

Parameters
filenameThe filename.
separatorThe separator character.
qualifierThe qualifier character ('\0' if no qualifier should be used).
See also
JobDataCsv, Passing Files

Property Documentation

◆ Filename

string Filename
getset

Gets/Sets the filename of the CSV file.

Returns
The filename of the CSV file
See also
Passing Files

◆ HandleEscapeSequences

bool HandleEscapeSequences
getsetinherited

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

◆ Qualifier

char Qualifier
getset

Gets/Sets the qualifier character that encloses DataField values.

Returns
The qualifier character that encloses DataField values

The default qualifier is the double quote ("). To disable the use of a qualifier set it to '\0'.

◆ RecordCopyDataField

string RecordCopyDataField
getset

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

Returns
The name of the DataField which holds the number of Record copies
See also
JobData, DataField

◆ ReuseValues

bool ReuseValues
getsetinherited

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

Returns
false if DataField-values should be cleared between Records
See also
JobData, DataField

◆ Separator

char Separator
getset

Gets/Sets the separator character that separates DataField names or DataField values.

Returns
The separator character that separates DataField names or DataField values

The default separator character is the comma (,).


© 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