ERRCODE TFormer_SetDataFile ( HTFORM  pInstance,
LPCSTR  pszFileName 
)

Sets a XML file in internal TFORMer format as DataSource.

Returns:
- ErrOk (0) in case of success
- Non-zero if error occurred
Parameters:
[in] pInstance The TFORMer-Instance provided by a previous call to TFormer_Init.
[in] pszFileName Data File Name (in internal TFORMer XML format)
Remarks:
Usually the methods TFormer_SetVarValue and TFormer_NewRecord are used to hand over variable data to TFORMer Runtime. However - with this function you can provide a data file, which contains all required input data (DataFields).
The specified data file must be conforming to the internal TFORMer format. Normally this function is not required by users. Instead, check out the functions TFormer_SetTxtDataFile or TFormer_SetXmlDataFile. If no data was supplied (either by TFormer_SetXXXDataFile or by TFormer_SetVarValue) TFORMer Runtime tries to use the default data-file which was generated by the last TFORMer Designer session for this FormLayout.
This function enables TFORMer Runtime to use XML-files (in a format which is used internally by TFORMer) as a DataSource for printing a Job. The specified XML-file must comply to the formats recognized by TFORMer. The following XML formats can be used:

Note:
Behavior if no input data was supplied: If no DataSource was specified (either by TFormer_SetXXXDataFile, TFormer_SetODBCData or via TFormer_NewRecord and TFormer_SetVarValue) the default data-file (located in the same directory as the FormLayout itself and generated by the last TFORMer Designer session) is used. If this default data-file does not exists no output will be produced. The name of the default data-file is path/FormName.xml.

A data file may be passed in the following ways:

  • Specify the filename directly.
  • Specify the filename of a ZIP-file (e.g. with WinZip) containing the required file.
  • BASE64-encode the content of the required file (see Convert class of .NET) and use this string instead of a filename.
  • BASE64-encode the content of a ZIP-file (see Convert class of .NET) containing the required file(s). Use this string instead of a filename.

Note:
BASE64 encoded strings must start with the sequence BASE64:. When passing a zipped file TFORMer expects a real WinZip compatible format. A zipped stream is not suitable! For more details please refer to the TFORMer Runtime DLL Programming Reference.

Must be called before TFormer_Print. When using a Repository-based FormLayout call this function after TFormer_SetFormName, if using a stand-alone FormLayout (*.tff) then call this function after TFormer_SetRepositoryName.

See also:
TFormer_SetRepositoryName, TFormer_SetFormName.


© 2006-2009 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Sep 2 16:01:09 2009 for TFORMer Runtime DLL/Shared Library with doxygen 1.5.8