TFORMer SDK - NET
7.0
|
Abstract class for a DataSource.
Public Member Functions | |
ComputedField | AddComputedField (string name) |
Creates and adds a ComputedField to the DataSource. | |
DSFieldMapping | AddFieldMapping (string name) |
Creates and adds a DSFieldMapping to the DataSource. | |
DataSourceParameter | AddParameter (string name) |
Creates and adds a DataSourceParameter to the DataSource. | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | |
ComputedField | GetComputedField (string name) |
Gets a ComputedField defined in the DataSource. | |
DSFieldMapping | GetFieldMapping (string name) |
Gets a DSFieldMapping defined in the DataSource. | |
DataSourceParameter | GetParameter (string name) |
Gets a DataSourceParameter defined in the DataSource. | |
void | RemoveComputedField (string name) |
Removes the ComputedField from the DataSource. | |
void | RemoveComputedField (ComputedField computedField) |
Removes the ComputedField from the DataSource. | |
void | RemoveFieldMapping (string name) |
Removes the DSFieldMapping from the DataSource. | |
void | RemoveFieldMapping (DSFieldMapping fieldMapping) |
Removes the DSFieldMapping from the DataSource. | |
void | RemoveParameter (string name) |
Removes the DataSourceParameter from the DataSource. | |
void | RemoveParameter (DataSourceParameter datasourceParameter) |
Removes the DataSourceParameter from the DataSource. | |
override string | ToString () |
Returns a string representation of the instance. | |
Properties | |
string | Comment [get, set] |
Gets/Sets the comment for the DataSource. | |
string | CopyColumnName [get, set] |
Gets/Sets the CopyColumnName of the DataSource. | |
string | Description [get, set] |
Gets/Sets the description of the DataSource. | |
ComputedField | FirstComputedField [get] |
Gets the first ComputedField defined in the DataSource. | |
DSFieldMapping | FirstFieldMapping [get] |
Gets the first DSFieldMapping defined in the DataSource. | |
DataSourceParameter | FirstParameter [get] |
Gets the first DataSourceParameter defined in the DataSource. | |
bool | HandleEscapeSequences [get, set] |
Gets/Sets if escape sequences should be translated on data retrieval or not. | |
bool | IsDefault [get] |
Gets a value indicating whether this object stores the default DataSource. | |
string | Name [get, set] |
Gets/Sets the name of the DataSource. | |
DataSource | Next [get] |
Gets the next DataSource instance defined in the Project. | |
int | NumberOfComputedFields [get] |
Gets the number of ComputedFields defined in the DataSource. | |
int | NumberOfFieldMappings [get] |
Gets the number of DSFieldMappings defined in the DataSource. | |
int | NumberOfParameters [get] |
Gets the number of DataSourceParameters defined in the DataSource. | |
DataSourceType | Type [get] |
Gets the type of the DataSource. |
Abstract class for a DataSource.
_Default_
. This DataSource is used for printing as long as neither a DataSource is specified for JobData nor the FormLayout has an active DataSource set in design. This DataSource retrieves the data from the file that is stored along with the FormLayout file (extension .xml) and contains the DataField values entered during the last TFORMer Designer session.The available DataSource-classes are DataSourceCsv, DataSourceOdbc and DataSourceXml.void IterateDataSourcesProject (Project project) { // Iterate all DataSources of the Project for (DataSource ds = project.FirstDataSource; ds != null; ds = ds.Next) { Console.WriteLine (ds.ToString ()); // Print information for the DataSourceParameters of the DataSource for (DataSourceParameter dsParam = ds.FirstParameter; dsParam != null; dsParam = dsParam.Next) Console.WriteLine (dsParam.ToString ()); // Print information for the ComputedFields of the DataSource for (ComputedField dsComp = ds.FirstComputedField; dsComp != null; dsComp = dsComp.Next) Console.WriteLine (dsComp.ToString ()); // Print the mapping between source fields and DataFields for (DSFieldMapping dsFieldmap = ds.FirstFieldMapping; dsFieldmap != null; dsFieldmap = dsFieldmap.Next) Console.WriteLine (dsFieldmap.ToString ()); } }
// Create a new Repository instance using a Repository (extension *.tfr) // Examples are usually installed in // - Windows Vista: C:/Program Data/TEC-IT/TFORMer/7.0/Examples // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples Repository repository = new Repository(@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples/Demo Repository/Demos.tfr", false, true);
// Iterate the DataSources of the global Project // If a Repository is used, the global Project and additional user-defined Projects may exist Console.WriteLine ("Global project"); IterateDataSourcesProject (repository.GlobalProject); // Iterate additional Projects // Additional Projects are only possible when using a Repository for (Project project = repository.FirstProject; project != null; project = project.Next) { Console.WriteLine (project.ToString ()); // Iterate the DataSources of the Project IterateDataSourcesProject (project); }
Sample code that iterates all DataSource-objects of a given stand-alone FormLayout:
void IterateDataSourcesProject (Project project) { // Iterate all DataSources of the Project for (DataSource ds = project.FirstDataSource; ds != null; ds = ds.Next) { Console.WriteLine (ds.ToString ()); // Print information for the DataSourceParameters of the DataSource for (DataSourceParameter dsParam = ds.FirstParameter; dsParam != null; dsParam = dsParam.Next) Console.WriteLine (dsParam.ToString ()); // Print information for the ComputedFields of the DataSource for (ComputedField dsComp = ds.FirstComputedField; dsComp != null; dsComp = dsComp.Next) Console.WriteLine (dsComp.ToString ()); // Print the mapping between source fields and DataFields for (DSFieldMapping dsFieldmap = ds.FirstFieldMapping; dsFieldmap != null; dsFieldmap = dsFieldmap.Next) Console.WriteLine (dsFieldmap.ToString ()); } }
// Create a new Repository instance using a stand-alone FormLayout (extension *.tff) // Examples are usually installed in // - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/7.0/Examples // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples Repository repository = new Repository(@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff", false, true);
// Iterate the DataSources of the global Project // If a stand-alone FormLayout is used, the global Project is the only Project Console.WriteLine ("Global project"); IterateDataSourcesProject (repository.GlobalProject);
Related documentation:
@note Thread-safety: A single instance of this class must not be used by different threads. @see DataSourceCsv, DataSourceOdbc, DataSourceXml
ComputedField AddComputedField | ( | string | name | ) |
Creates and adds a ComputedField to the DataSource.
name | The name of the ComputedField |
DSFieldMapping AddFieldMapping | ( | string | name | ) |
Creates and adds a DSFieldMapping to the DataSource.
name | The name of the DataField for which a DSFieldMapping should be created. |
DataSourceParameter AddParameter | ( | string | name | ) |
Creates and adds a DataSourceParameter to the DataSource.
name | The name of the DataSourceParameter |
void Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
ComputedField GetComputedField | ( | string | name | ) |
Gets a ComputedField defined in the DataSource.
name | The name of the ComputedField |
null
DSFieldMapping GetFieldMapping | ( | string | name | ) |
Gets a DSFieldMapping defined in the DataSource.
Retrieves the DSFieldMapping for a given DataField name from the DataSource
name | The name of a DataField |
null
DataSourceParameter GetParameter | ( | string | name | ) |
Gets a DataSourceParameter defined in the DataSource.
name | The name of the DataSourceParameter |
null
void RemoveComputedField | ( | string | name | ) |
Removes the ComputedField from the DataSource.
name | The name of the ComputedField |
void RemoveComputedField | ( | ComputedField | computedField | ) |
Removes the ComputedField from the DataSource.
computedField | The ComputedField |
void RemoveFieldMapping | ( | string | name | ) |
Removes the DSFieldMapping from the DataSource.
name | The name of the DataField for which the mapping should be deleted |
void RemoveFieldMapping | ( | DSFieldMapping | fieldMapping | ) |
Removes the DSFieldMapping from the DataSource.
fieldMapping | The DSFieldMapping |
void RemoveParameter | ( | string | name | ) |
Removes the DataSourceParameter from the DataSource.
name | The name of the DataSourceParameter |
void RemoveParameter | ( | DataSourceParameter | datasourceParameter | ) |
Removes the DataSourceParameter from the DataSource.
datasourceParameter | The DataSourceParameter |
override string ToString | ( | ) |
Returns a string representation of the instance.
Reimplemented in DataSourceOdbc, DataSourceCsv, and DataSourceXml.
string Comment [get, set] |
Gets/Sets the comment for the DataSource.
string CopyColumnName [get, set] |
Gets/Sets the CopyColumnName of the DataSource.
string Description [get, set] |
Gets/Sets the description of the DataSource.
Gets the first ComputedField defined in the DataSource.
null
Gets the first DSFieldMapping defined in the DataSource.
null
Gets the first DataSourceParameter defined in the DataSource.
null
bool HandleEscapeSequences [get, set] |
Gets/Sets if escape sequences should be translated on data retrieval or not.
true
if escape sequences should be translated.bool IsDefault [get] |
Gets a value indicating whether this object stores the default DataSource.
true
if this DataSource is the default DataSource.string Name [get, set] |
Gets/Sets the name of the DataSource.
DataSource Next [get] |
Gets the next DataSource instance defined in the Project.
A Project stores a list of DataSource objects. To retrieve the first DataSource in the Project see Project.FirstDataSource.
null
if there aren't other instances in the Project, otherwise a valid instance of this class (DataSourceCsv, DataSourceOdbc or DataSourceXml)int NumberOfComputedFields [get] |
Gets the number of ComputedFields defined in the DataSource.
int NumberOfFieldMappings [get] |
Gets the number of DSFieldMappings defined in the DataSource.
int NumberOfParameters [get] |
Gets the number of DataSourceParameters defined in the DataSource.
DataSourceType Type [get] |
Gets the type of the DataSource.
The DataSourceType is read-only, and is set on creation. It specifies the type of a DataSource (e.g. DataSourceOdbc, DataSourceCsv, DataSourceXml).
© 2006-2012 - all rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Tue Oct 23 2012 16:33:21 for TFORMer SDK - NET with doxygen 1.8.0 |