IJobDataDataSource interface

Library: TFORMer9Lib

Provides access to a user-defined DataSource, which is defined in the FormLayout or a Repository.

Usage and notes

Overview

A data source defined for a FormLayout supplies input records for generating output. Use JobDataDataSource to supply this data source as the JobData of a Job.

The creator of a FormLayout is able to define such a DataSource with TFORMer Designer. This DataSource definition is stored as part of the FormLayout and is identified by a unique name. It defines how data is retrieved (e.g. from an ODBC database), the field-mappings and optional DataSourceParameters.

If you specify no or an empty name when using the JobDataDataSource, TFORMer SDK uses the DataSource selected in the FormLayout. This need not be the special _Default_ source.

The _Default_ source reads the DataField values saved by TFORMer Designer alongside the layout in its companion .xml file. The SDK also falls back to that file when no source is selected in the layout. If this file supplies the input and is absent, its saved records are not available for output.

The optional DataSourceParameters can change settings such as the input filename, SQL SELECT statement or ODBC DSN at runtime.

Examples

The following example selects a data source defined in the form layout, sets a data source parameter, and generates a PDF file.

  ' Create TFORMer SDK instance '
  Set tformer = CreateObject("TFORMer9Lib.TFormer")

  ' Create a new Job instance '
  Set printJob = tformer.CreateJob

  ' Select the stand-alone FormLayout named (6) Samples_Picking List.tff '
  ' This FormLayout is usually installed as part of TFORMer in '
  ' - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/9/Templates '
  ' - Older versions of Microsoft Windows: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Templates '
  printJob.RepositoryName = "C:\Documents and Settings\All Users\Application Data\TEC-IT\TFORMer\9\Templates\(6) Samples_Picking List.tff"

  ' Create a new JobData instance using the DataSource named "ODBC" defined inside the Formlayout '
  Set jobData = printJob.NewJobDataDataSource("ODBC")

  ' Specify any DataSourceParameters '
  jobData.SetParameterValue "PickingListParameter", "2"

  ' 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.

Base types: IJobData

Inherited members (2)

Properties

MemberDescription
NameString { get; set; }

Gets/Sets the name of the DataSource.

Methods

MemberDescription
SetParameterValue(String, String)

Sets the value for a DataSourceParameter.

Search documentation

Search in
More scopes
Additional scopes

All contents