TFORMer SDK - DLL/Library  9
JobDataRecordSet

Overview

The JobDataRecordSet is the preferred method to pass data to TFORMer SDK from within program code. Create and fill a JobDataRecordSet and pass it to the Job using JobData.

The JobDataRecordSet represents an in-memory list of Records. Each Record holds a collection of pairs of strings. The first member of such a string-pair denotes the name of the DataField, the second member denotes the value of the DataField.

Although not required it is good practice to set all DataFields used in the FormLayout for each Record. If a DataField which is used in the FormLayout is not present in the JobData 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.

  // Create a new Job 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.


© 2006-2026 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Fri Feb 6 2026 10:32:55 for TFORMer SDK - DLL/Library with doxygen 1.7.6.1