This sample demonstrates functions to access or modify the information stored in a Repository.
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
class RepositorySamples
{
{
Repository repository =
new Repository(
@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff",
false,
true);
return repository;
}
{
Repository repository =
new Repository(
@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples/Demo Repository/Demos.tfr",
false,
true);
return repository;
}
void DataFieldUsageStandAloneForm ()
{
Repository repository = ConnectToStandAloneForm ();
while (datafield != null)
{
{
case DataFieldUsage.Calculated: Console.Write (
"--> The value of this DataField is computed within the FormLayout");
break;
case DataFieldUsage.Invalid : Console.Write ("--> Invalid usage - contact TEC-IT"); break;
case DataFieldUsage.Normal : Console.Write ("--> The DataField is used within the FormLayout; its value can be set"); break;
case DataFieldUsage.NotUsed : Console.Write ("--> This DataField is not used in this FormLayout"); break;
case DataFieldUsage.Parameter : Console.Write ("--> This is a system DataField (like the page number) used within the FormLayout"); break;
}
Console.WriteLine();
datafield = datafield.
Next;
}
}
void FetchFormLayoutStandAloneForm ()
{
Repository repository = ConnectToStandAloneForm ();
if (project != null)
{
if (formlayout != null)
{
}
}
}
void IterateProjects ()
{
while (project != null)
{
}
}
void IterateFormLayoutsRepository ()
{
while (project != null)
{
while (formlayout != null)
{
formlayout = formlayout.
Next;
}
}
}
void IterateDataFieldsStandAloneForm ()
{
Repository repository = ConnectToStandAloneForm ();
while (datafield != null)
{
Console.WriteLine (datafield.
Name);
datafield = datafield.
Next;
}
}
void DataSourceOdbcModify ()
{
Repository repository = ConnectToStandAloneForm ();
dataSource.User = "";
dataSource.Password = "";
}
void DataSourceCsvModify ()
{
Repository repository = ConnectToStandAloneForm ();
dataSource.Qualifier = "'";
dataSource.Separator = ",";
}
void DataSourceXmlModify ()
{
Repository repository = ConnectToStandAloneForm ();
dataSource.XsltFilename = "";
}
void IterateDataSourcesProject (
Project project)
{
{
Console.WriteLine (ds.ToString ());
Console.WriteLine (dsParam.ToString ());
for (
ComputedField dsComp = ds.FirstComputedField; dsComp !=
null; dsComp = dsComp.
Next)
Console.WriteLine (dsComp.ToString ());
for (
DSFieldMapping dsFieldmap = ds.FirstFieldMapping; dsFieldmap !=
null; dsFieldmap = dsFieldmap.
Next)
Console.WriteLine (dsFieldmap.ToString ());
}
}
void IterateDataSources ()
{
Console.WriteLine ("Global project");
{
Console.WriteLine (project.ToString ());
IterateDataSourcesProject (project);
}
}
void IterateDataSourcesStandAloneForm ()
{
Repository repository = ConnectToStandAloneForm ();
Console.WriteLine ("Global project");
}
static void Main(string[] args)
{
RepositorySamples sample = new RepositorySamples();
sample.DataFieldUsageStandAloneForm ();
sample.FetchFormLayoutStandAloneForm ();
sample.IterateProjects ();
sample.IterateFormLayoutsRepository ();
sample.IterateDataFieldsStandAloneForm();
sample.IterateDataSources ();
sample.IterateDataSourcesStandAloneForm();
}
}
Provides access to a ComputedField which is referenced by a DataSource.
Definition: ComputedField.cs:54
ComputedField Next
Gets the next ComputedField defined in the DataSource.
Definition: ComputedField.cs:315
DSFieldMapping defines the field-mappings between a DataSource and the DataFields used in a Formlayou...
Definition: DSFieldMapping.cs:20
DSFieldMapping Next
Gets the next DSFieldMapping in the DataSource.
Definition: DSFieldMapping.cs:137
Provides access to DataField information.
Definition: DataField.cs:57
DataField Next
Gets the next DataField defined in the Project.
Definition: DataField.cs:416
string Name
Gets/Sets the name of the DataField.
Definition: DataField.cs:174
override string ToString()
Returns a string representation of the instance.
Definition: DataField.cs:520
Specialized DataSource for CSV data (character separated values).
Definition: DataSourceText.cs:17
Abstract class for a DataSource.
Definition: DataSource.cs:56
DataSource Next
Gets the next DataSource instance defined in the Project.
Definition: DataSource.cs:370
Specialized DataSource for ODBC data.
Definition: DataSourceODBC.cs:17
Provides access to properties of a DataSourceParameter.
Definition: DataSourceParameter.cs:17
DataSourceParameter Next
Gets the next DataSourceParameter defined in the DataSource.
Definition: DataSourceParameter.cs:245
Specialized DataSource for XML data.
Definition: DataSourceXML.cs:17
Provides access to Project information of a Repository or a stand-alone link FormLayout.
Definition: Project.cs:22
FormLayout FirstFormLayout
Gets the first FormLayout of the Project.
Definition: Project.cs:295
DataSource GetDataSource(string name)
Gets the DataSource information from the Project.
Definition: Project.cs:613
DataSource FirstDataSource
Gets the first DataSource defined in the Project.
Definition: Project.cs:255
DataField FirstDataField
Gets the first DataField of the Project.
Definition: Project.cs:215
Project Next
Gets the next Project defined in the Repository.
Definition: Project.cs:193
override string ToString()
Returns a string representation of the instance.
Definition: Project.cs:648
Opens or creates a Repository, opens a stand-alone FormLayout.
Definition: Repository.cs:24
Project GlobalProject
Gets the global Project of the Repository.
Definition: Repository.cs:478
Project FirstProject
Gets the first Project stored in the Repository.
Definition: Repository.cs:456
DataFieldUsage
Describes the usage of a DataField within a FormLayout.
Definition: FormLayout.cs:15