JobDataRecordSet class

Namespace: TECIT.TFORMer

Provides access to JobDataRecordSet (a set of in-memory Record objects which serves as JobData for a Job).

Usage and notes

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 used in the FormLayout is not supplied for a Record, 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.

Note

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

Base types: JobData

Inherited members (2)

Properties

MemberDescription
RecordsList< Record > { get; set; }

Gets/Sets the list of Records.

Search documentation

Search in
More scopes
Additional scopes

All contents