TFORMer SDK - NET 8
Public Member Functions | Properties | List of all members
FormLayout Class Reference

Provides access to a FormLayout which is referenced by a Repository or available as stand-alone FormLayout. More...

Public Member Functions

void Design (string designer, bool showSplashScreen, bool maximizeWindow, bool useExistingInstance, string extraParameters)
 Opens the FormLayout with TFORMer Designer. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
DataFieldUsage GetDataFieldUsage (string dataFieldName)
 Retrieves the usage of a specific DataField in a FormLayout. More...
 
override string ToString ()
 Returns a string representation of the instance. More...
 

Properties

string Comment [get, set]
 Gets/Sets the comment for the FormLayout. More...
 
string Description [get, set]
 Gets/Sets the description of the FormLayout. More...
 
string Filename [get, set]
 Gets/Sets the filename of the FormLayout. More...
 
string Name [get, set]
 Gets/Sets the name of the FormLayout. More...
 
FormLayout Next [get]
 Gets the next FormLayout in the Project. More...
 

Detailed Description

Provides access to a FormLayout which is referenced by a Repository or available as stand-alone FormLayout.

Overview

A FormLayout is a document which was created with TFORMer Designer. This class is used to retrieve or set information belonging to a FormLayout.

A typical FormLayout contains static content (like a logo), dynamic content (like a DataField) and a number of properties which are used to describe the FormLayout and its behavior during print-time. Each FormLayout is member of exactly one Project (in the case of a Repository) or the GlobalProject (in the case of a stand-alone FormLayout).

Note
It is not possible to change the appearance of the FormLayout (like adding new elements or bands) with this class. Design tasks are supported by TFORMer Designer only.

Repository-based FormLayouts


General

Printing

When printing a specific FormLayout within a Repository 3 parameters must be specified to identify the FormLayout:

Stand-Alone FormLayout


General

Printing

When printing a Job using a stand-alone FormLayout 1 parameter must be specified:

Note
Do not use Job.ProjectName and Job.FormName when using a stand-alone FormLayout!

Determining Used DataFields


In order to access the data-fields in a FormLayout you may either use the method Project.GetDataField or you may iterate through all available data-fields using Project.FirstDataField and DataField.Next. If you want to know, whether the returned DataField is actually used you can use the method FormLayout.GetDataFieldUsage.

Sample


To retrieve the FormLayout object within a stand-alone FormLayout do the following:

// Retrieve the global Project
// A stand-alone FormLayout contains only the global Project, the global Project contains the FormLayout
Project project = repository.GlobalProject;
if (project != null)
{
Console.Write(project.ToString());
// Retrieve the first (and only) FormLayout
FormLayout formlayout = project.FirstFormLayout;
if (formlayout != null)
{
Console.Write(formlayout.ToString());
}
}
Provides access to a FormLayout which is referenced by a Repository or available as stand-alone FormL...
Definition: FormLayout.cs:66
override string ToString()
Returns a string representation of the instance.
Definition: FormLayout.cs:532
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
override string ToString()
Returns a string representation of the instance.
Definition: Project.cs:648
Project GlobalProject
Gets the global Project of the Repository.
Definition: Repository.cs:478

To retrieve all FormLayout objects within a Repository do the following:

// Retrieve the first Project
Project project = repository.FirstProject;
while (project != null)
{
Console.Write(project.ToString());
// Retrieve the first FormLayout in this Project
FormLayout formlayout = project.FirstFormLayout;
while (formlayout != null)
{
Console.Write(formlayout.ToString());
// Get the next FormLayout in this Project
formlayout = formlayout.Next;
}
// Get the next Project
project = project.Next;
}
FormLayout Next
Gets the next FormLayout in the Project.
Definition: FormLayout.cs:307
Project Next
Gets the next Project defined in the Repository.
Definition: Project.cs:193
Project FirstProject
Gets the first Project stored in the Repository.
Definition: Repository.cs:456
Attention
The FormLayout is only valid as long as it is available in the Project. If it is removed from the Project all instances of the FormLayout become invalid immediately.
Note
Thread-safety: A single instance of this class must not be used by different threads.

Member Function Documentation

◆ Design()

void Design ( string  designer,
bool  showSplashScreen,
bool  maximizeWindow,
bool  useExistingInstance,
string  extraParameters 
)

Opens the FormLayout with TFORMer Designer.

TFORMer SDK on its own cannot be used for editing a FormLayout. Use this method to invoke TFORMer Designer.

Note
Make sure that your purchased license model fits your requirements. If you are creating applications which are distributed to 3rd party you may need to redistribute TFORMer Designer as well.
Parameters
designerThe path and name of the TFORMer Designer executable. If null then the method tries to find the executable automatically
showSplashScreenIf set to true the splash screen is shown
maximizeWindowIf set to true the TFORMer Designer windows is maximized
useExistingInstanceIf set to true the form-layout will be opened in an already running TFORMer Designer instance
extraParametersAdditional parameters that will be passed to TFORMer Designer

◆ Dispose()

void Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ GetDataFieldUsage()

DataFieldUsage GetDataFieldUsage ( string  dataFieldName)

Retrieves the usage of a specific DataField in a FormLayout.

Parameters
dataFieldNameName of the DataField to be queried.
Returns
A valid object instance or null
See also
DataField

Sample: To query all DataField-objects within a stand-alone FormLayout refer to the code below. The same principle can be used for a Repository-based FormLayout.

// Retrieve the global Project
// A stand-alone FormLayout contains only the global Project, the global Project holds the FormLayout and all DataField definitions
Project project = repository.GlobalProject;
// Retrieve the one and only FormLayout within the stand-alone FormLayout
FormLayout formlayout = project.FirstFormLayout;
// Iterate all DataFields within the Project
DataField datafield = project.FirstDataField;
while (datafield != null)
{
Console.Write(datafield.ToString());
// Retrieve the usage of the DataFields in the FormLayout
switch (formlayout.GetDataFieldUsage (datafield.Name))
{
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;
}
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
DataFieldUsage GetDataFieldUsage(string dataFieldName)
Retrieves the usage of a specific DataField in a FormLayout.
Definition: FormLayout.cs:367
DataField FirstDataField
Gets the first DataField of the Project.
Definition: Project.cs:215
DataFieldUsage
Describes the usage of a DataField within a FormLayout.
Definition: FormLayout.cs:15

◆ ToString()

override string ToString ( )

Returns a string representation of the instance.

Returns
A string representation of the instance

Property Documentation

◆ Comment

string Comment
getset

Gets/Sets the comment for the FormLayout.

Returns
The comment for the FormLayout.

◆ Description

string Description
getset

Gets/Sets the description of the FormLayout.

Returns
The description of the FormLayout.

◆ Filename

string Filename
getset

Gets/Sets the filename of the FormLayout.

Returns
The filename of the FormLayout.

◆ Name

string Name
getset

Gets/Sets the name of the FormLayout.

Returns
The name of the FormLayout.

◆ Next

FormLayout Next
get

Gets the next FormLayout in the Project.

To retrieve the first FormLayout within a Project (or the GlobalProject) refer to Project.FirstFormLayout. When using a stand-alone FormLayout this property always returns null. In this case only one FormLayout is available - it can be retrieved via Repository.GlobalProject.

Returns
The next FormLayout object available or null.
See also
Project

© 2006-2023 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Thu Dec 28 2023 18:45:19 for TFORMer SDK - NET with doxygen 1.9.4