TFORMer SDK - DLL/Library  8
JobDataDataSource

Overview

The JobDataDataSource enables TFORMer SDK to use a DataSource defined as part of a FormLayout as JobData for printing 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 default DataSource specified in the FormLayout. The default JobDataDataSource stores the DataField values used during the last TFORMer Designer session (for this purpose TFORMer Designer maintains an extra file with the extension .xml). If no file with default data exists TFORMer SDK produces no output.

The optional DataSourceParameters may be used to control certain aspects of the JobDataDataSource (like file names, SQL SELECT statement or an ODBC-DSN) during runtime.

Examples

Sample tff has no datasource (remove Sample?) move it to samples ? The following sample will use a predefined DataSource. Set one DataSourceParameter and send the output to the default printer.

  // 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/8/Templates
  // - Older versions of Microsoft Windows: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Templates
  TFormer_SetRepositoryName (hTForm, "C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Templates/(6) Samples_Picking List.tff");  
      
  // Here we are using the DataSource named "ODBC" defined inside the Formlayout 
  eCode = TFormer_SetDatasourceName  (hTForm, "ODBC");
  
  // Select PDF output
  if (eCode == ErrOk)
    eCode = TFormer_SetPrinterType  (hTForm, ePrinterType_PDFFile);

  // To /temp/out.pdf
  if (eCode == ErrOk)
    eCode = TFormer_SetOutputName   (hTForm, "/temp/out.pdf");

  // Generate output based on the FormLayout and the JobData
  if (eCode == ErrOk)
    eCode = TFormer_Print           (hTForm);

More Information

For a general description see JobData.


© 2006-2021 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Nov 17 2021 12:13:03 for TFORMer SDK - DLL/Library with doxygen 1.7.6.1