TFORMer SDK - DLL/Library
8
|
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'
.
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 // Select the FormLayout (stand-alone or Repository-based) // ... // Here we import a CSV and specify separator and qualifier character eCode = TFormer_SetTxtDataFile (hTForm, "c:/temp/Import.txt", ',', '\"'); // Select PDF output if (eCode == ErrOk) eCode = TFormer_SetPrinterType (hTForm, ePrinterType_PDFFile); // To /temp/out.pdf if (eCode == ErrOk) eCode = TFormer_SetOutputName (hTForm, "/temp/out.pdf"); // Generate output based on the FormLayout and the JobData if (eCode == ErrOk) eCode = TFormer_Print (hTForm);
For a general description see JobData.
© 2006-2024 - all rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Sat Oct 5 2024 05:08:16 for TFORMer SDK - DLL/Library with doxygen 1.7.6.1 |