FAQ: TFORMer SDK
Retrieving Data Fields Used in a Layout (TFORMer. NET API)
Retrieving Data Fields Used in a Layout (TFORMer. NET API)
Data fields in a repository
Repository repository = new Repository ("C:\\Path\\Labels.tfr", false, false);
Project project = repository.GetProject("BarcodeLabels");
FormLayout formlayout = project.GetFormLayout("Label1");
// iterate through all DataFields in the project
for (DataField field = project.FirstDataField; field != null; field = field.Next)
{
// check if the DataField is used in the FormLayout
DataFieldUsage usage = formlayout.GetDataFieldUsage(field.Name);
if (usage == DataFieldUsage.Normal)
{
// DataField used in the FormLayout
}
}
Data fields in a TFF
// create a Repository-instance using a stand-alone FormLayout
Repository repo = new Repository("C:\\Path\\Label.tff", false, false);
// retrieves the global project
Project project = repo.GlobalProject;
// retrieves the one and only FormLayout (stand-alone form)
FormLayout formlayout = project.FirstFormLayout;
// retrieving the data fields:
// use the same code as with the repository (see above)