JobDataRecordSet
Overview
Supply records directly to the same TFORMer instance; no separate JobDataRecordSet object is required.
-
To replace previously supplied records, call TFormer_ResetData first.
-
Call TFormer_NewRecord to start a record.
-
Call TFormer_SetVarValue for each DataField in that record, passing its name and value as strings.
-
Repeat the last two steps for each additional record.
Although not required it is good practice to set all DataFields used in the FormLayout for each Record. If a DataField used in the FormLayout is not supplied for a Record, its value depends on TFormer_SetReuseValues.
By default each Record is used for printing exactly once. This behavior can be changed with TFormer_SetRecordCopy.
Example
This example provides 2 records. It sets the values for the DataFields ArticleNo, ArticleName and ArticlePrice. The second record will be printed two times.
// Use an initialized TFORMer instance
// Select the FormLayout (stand-alone or Repository-based)
// ...
// Clear the Data Cache
eCode = TFormer_ResetData (hTForm);
// Create a new Record
eCode = TFormer_NewRecord (hTForm);
// Populate the Record with key/value pairs to define the DataField values
eCode = TFormer_SetVarValue (hTForm, "ArticleName", "Speaker System HF1");
eCode = TFormer_SetVarValue (hTForm, "ArticleNo", "12001234");
eCode = TFormer_SetVarValue (hTForm, "ArticlePrice", "498.98");
// Create a Second Record
eCode = TFormer_NewRecord (hTForm);
// This Record should be printed two times
eCode = TFormer_SetRecordCopy (hTForm, 2);
// Populate the Record with key/value pairs to define the DataField values
eCode = TFormer_SetVarValue (hTForm, "ArticleName", "Record Box 12 CDs");
eCode = TFormer_SetVarValue (hTForm, "ArticleNo", "12021231");
eCode = TFormer_SetVarValue (hTForm, "ArticlePrice", "8.85");
// 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);
More Information
For a general description see JobData.