IJobDataOdbc interface

Library: TFORMer9Lib

Provides access to JobDataOdbc (an ODBC connection that serves as JobData for a Job).

Usage and notes

Overview

An ODBC query supplies records from database tables for generating output. Use JobDataOdbc to supply the query results as the JobData of a Job.

The data in such a table provides the values of the DataFields. The table is read Record by Record using the specified SQL SELECT statement. TFORMer SDK matches the column-names of the table or query with the corresponding DataField names in the FormLayout. If required use SQL aliases to provide identical column names.

The order of the columns in the table or query does not matter.

The DSN identifies an ODBC data source configured on the system. On Windows, configure it using the ODBC Data Source Administrator. Include DSN=... in the connection string, as shown below.

This may yield the following code:

  ' Set the DSN programmatically '
  jobDataOdbc.Dsn = "DSN=TFORMer_Sample"

Example

This example assumes an ODBC data source named TFORMer_Sample with the table tbl_Example shown below.

ChapterNumber

Caption

PageNumber

1

Content

2

1.1

Table of Figures

6

1.2

List of Tables

6

2

Disclaimer

7

...

...

...

The following example uses this table to generate PDF output.

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

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

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

  ' Create a new JobData instance using the installed sample ODBC connection named TFORMer_Sample '
  Set jobData = printJob.NewJobDataOdbc ("DSN=TFORMer_Sample", "", "", "SELECT * FROM tbl_Example")

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

See also

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
DsnString { get; set; }

Gets/Sets the DSN (ODBC data-source-name).

PasswordString { get; set; }

Gets/Sets the password for the database connection.

RecordCopyDataFieldString { get; set; }

Gets/Sets the name of the DataField which specifies the number of Record copies.

SqlSelectString { get; set; }

Gets/Sets the SQL select statement for fetching the records from the database.

UserString { get; set; }

Gets/Sets the user-name for the database connection.

Search documentation

Search in
More scopes
Additional scopes

All contents