TFORMer SDK - NET  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 JobData.ReuseValues.

By default each Record is used for printing exactly once. This behavior can be changed with NumberOfCopies.

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
  Job printJob = new Job();

  // Select the FormLayout (stand-alone or Repository-based)
  // ...

  // Create a new JobData instance.
  // Here we are using the JobDataRecordSet which accepts Records containing name/value pairs
  JobDataRecordSet jobData = new JobDataRecordSet();

  // Create a new Record
  Record record = new Record();
  // Populate the Record with key/value pairs to define the DataField values
  record.Data.Add("ArticleName", "Speaker System HF1");
  record.Data.Add("ArticleNo", "12001234");
  record.Data.Add("ArticlePrice", "498.98");
  // Add the Record to the JobData
  jobData.Records.Add(record);

  // Create a second Record
  record = new Record();
  // This Record should be printed two times
  record.NumberOfCopies = 2;
  record.Data.Add("ArticleName", "Record Box 12 CDs");
  record.Data.Add("ArticleNo", "12021231");
  record.Data.Add("ArticlePrice", "8.85");
  jobData.Records.Add(record);

  // 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 ();

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:33:01 for TFORMer SDK - NET with doxygen 1.7.6.1