Data Containers (DC)

  • A data container (DC) groups a set of data elements (fields) in a transaction structure. The defined DC will appear as a frame in the form related to the structure. The fields defined in the DC are created as components in the form .The frames can be rearranged using the functionalities available in the Form Designer.
  • A DC is associated with a database table specified in the table name property of the DC.The fields in each DC are stored into this backend database table .
  • Every Tstruct should contain at least one data container (DC).When the Tstruct is created,a database table is also created by Axpert automatically. In the database table, a field named <tablename>id is created and made the primary key. For example if a table named t1 is created, the primary field is named as “t1id”. This will be created automatically by Axpert as a numeric field.

Types of DC

A DC could be any one of the following types :

  • Normal
  • Grid

Normal DC

By default, a DC in a Tstruct is created as a normal DC. A normal DC appears as a frame in the inputform which the fields in the DC are created as components. The type of component created depends on the mode of entry of the field.The first DC in a tstruct should  be a normal DC.

Grid DC

A Grid DC is created when the As Grid property is set to true.It produces a Grid frame in which each inputfield under the DC is shown as column in the Grid. A Grid frame allows multiple rows to be entered.  The table related to the grid DC is related is called the grid table.

Example

Consider a bill in which there are fields in the header like Document No, Date, Supplier Name, Address, etc and a detail table in which a list of products, quantity, rate and amount are required. In this case, the tstruct will contain a header DC and a details DC. The AsGrid property  for the detail DC is set to true.

Normal & Grid DC in a Tstruct with the corresponding frames in Form

Normal & Grid DC in a Tstruct with the corresponding frames in Form

Primary Table

A Tstruct can contain any number of DCs. Each DC can have a different table name. The table attached with the first DC is called the primary table. The table id of the primary table is created as a field in the grid table. So, when transactions are entered, for every row in primary table there can be many rows in the grid table. The rows in the primary table are related to the grid table through the primary table id.

More than one DC can point to the same table name. More than one Tstruct can point to the same database table. When more than one table is defined in a Tstruct, the tables are automatically related by storing the record id of the primary table in all the other tables.