IJobDataRecordSet interface
Library: TFORMer9Lib
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 SetNumberOfCopies.
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 TFORMer SDK instance '
Set tformer = CreateObject("TFORMer9Lib.TFormer")
' Create a new Job instance '
Set printJob = tformer.CreateJob
' 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 '
Set jobData = printJob.NewJobDataRecordSet
' Create a new Record '
jobData.AddNewRecord
' Populate the Record with key/value pairs to define the DataField values '
jobData.SetDataField "ArticleName", "Speaker System HF1"
jobData.SetDataField "ArticleNo", "12001234"
jobData.SetDataField "ArticlePrice", "498,98"
' Create a second Record '
jobData.AddNewRecord
' This Record should be printed two times '
jobData.SetNumberOfCopies 2
jobData.SetDataField "ArticleName", "Record Box 12 CDs"
jobData.SetDataField "ArticleNo", "12021231"
jobData.SetDataField "ArticlePrice", "8,85"
' 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.PrintForm
More Information
For a general description see JobData.
Note
Thread-safety: A single instance of this class must not be used by different threads.
Inheritance and related types
Base types: IJobData
Inherited members (2)
Methods
| Member | Description |
|---|---|
| AddNewRecord() | Adds a new Record. |
| AppendToDataField(String, String) | Appends the value to the current value of a DataField in the current Record. |
| ClearRecords() | Clears all Records. |
| SetDataField(String, String) | Sets the value of a DataField in the current Record. |
| SetNumberOfCopies(LONG) | Sets the number of Record copies. |