- Overview
- How to proceed?
- Adding a break into a Table control
- Break header and footer
- How to fill a Table control with breaks?
- Handling the controls found in the break headers and footers
- How to proceed?
- Example
- Automatic calculations in the breaks of a Table control
- Handling the break headers and footers
- To initialize the break headers and footers
- Properties associated with the break headers and footers
- WLanguage functions specific to the Table controls with breaks
Adding a break into a Table control To add a break into a Table control: - Display the description of the Table control ("Description" from the popup menu).
- In the "Content" tab, click
. The window for break management is displayed. Remark: The breaks are not available for the browsing Table controls with direct access. - Select the item on which the break must be performed. Several items can be selected in order to perform several breaks. The proposed items depend on the type of the Table control:
- Browsing Table control loaded in memory:
- automatic browse: the search item, the column linked to the search item and the columns linked to no item are proposed. If the search item corresponds to a composite key, the components of this composite key, the columns linked to these components and the columns linked to no item are proposed.
- programmed browse: the items of data file and the columns linked to these items are proposed.
- Browsing Table control linked to a query:
- automatic browse: the search item, the columns linked to this search item and the columns linked to no item are proposed. If the search item is not specified ("<Automatic>" option), the sorted items of the query, the columns linked to these items and the columns linked to no item are proposed.
- programmed browse: the query items, the columns linked to these items and the columns linked to no item are proposed.
- Memory Table control: all the columns found in the Table control are proposed.
- The breaks are performed according to their display order. Modify (if necessary) this order via the arrow buttons found on the right of table.
- Validate.
Break header and footer When adding a new break, a break header and a break footer are automatically added to the Table control. If the Table control includes several breaks, there will be as many break headers and break footers as the number of breaks. The break headers and the break footers appear in edit in the Table control. The characteristics of these break headers and footers (name, visibility, background color, ...) can be modified in their description window ("Description" from the popup menu). Each break header and break footer is associated with the event "Displaying a row". This event is run when a new break header or break footer is displayed in the Table control. These break headers and footers can contain controls. These controls can be handled by programming. Remarks: Versions 20 and later  In the description of the Table control ("Details" tab), if the type of fill is "Loaded in memory", the breaks can be collapsed/expanded via a simple click in the background of the break ("Collapsible/Expandable breaks via simple click in the background"). New in version 20  In the description of the Table control ("Details" tab), if the type of fill is "Loaded in memory", the breaks can be collapsed/expanded via a simple click in the background of the break ("Collapsible/Expandable breaks via simple click in the background").   In the description of the Table control ("Details" tab), if the type of fill is "Loaded in memory", the breaks can be collapsed/expanded via a simple click in the background of the break ("Collapsible/Expandable breaks via simple click in the background").
How to fill a Table control with breaks? For the browsing Table controls, the addition of records is automatically performed according to the file or to the associated query. The sort is performed according to the search item. For the memory Table controls, the data additions are performed by TableAddLine. In order for a Table control to be sorted according to the specified breaks, you must use TableSort. Example: Memory Table control: A break was defined on the Country and City columns:
// Fill the Table control TableAddLine(TABLE_Breaks, "FRANCE", "Montpellier", "TEXT1", "Text1") TableAddLine(TABLE_Breaks, "FRANCE", "Paris", "TEXT2", "Text2") TableAddLine(TABLE_Breaks, "FRANCE", "Montpellier", "TEXT3", "Text3") TableAddLine(TABLE_Breaks, "FRANCE", "Lille", "TEXT4", "Text4")
TableAddLine(TABLE_Breaks, "SPAIN", "Madrid", "TEXT1", "Text1") TableAddLine(TABLE_Breaks, "SPAIN", "Barcelona", "TEXT3", "Text3") TableAddLine(TABLE_Breaks, "SPAIN", "Barcelona", "TEXT4", "Text4")
TableAddLine(TABLE_Breaks, "ALGERIA", "Alger", "TEXT5", "Text5") TableAddLine(TABLE_Breaks, "ALGERIA", "Oran", "TEXT6", "Text6") TableAddLine(TABLE_Breaks, "ALGERIA", "Alger", "TEXT7", "Text7") TableAddLine(TABLE_Breaks, "ALGERIA", "Chlef", "TEXT8", "Text8") TableAddLine(TABLE_Breaks, "ALGERIA", "Alger", "TEXT9", "Text9")
TableAddLine(TABLE_Breaks, "SPAIN", "Madrid", "TEXT2", "Text2")
// Sort the content of the Table control according to the breaks TableSort(TABLE_Breaks, TABLE_Breaks.Country..Name, TABLE_Breaks.City..Name)
Handling the controls found in the break headers and footers How to proceed? To handle the controls found in the break headers and footers - handle each control found in all the break headers and footers:
<Control Name> .. <Property Name> = <Value> or <Table Name>.<Name of Break Header/Footer>.<Control Name>..<Property Name> = <Value>
- handle each control found in a given break:
<Table name>[<Subscript>].<Control name>..<Property name> = <Value>
<Subscript> corresponds to the row number for the break.
Remarks: - These code lines must be in the event "Displaying a row" of the break header / footer.
- Special case: Check Box control: a Check Box control containing several options and located in the break headers and footers cannot be assigned by programming. If several check boxes are required in the break headers and footers, we recommend that you use a Check Box control for each checkmark.
Example This code is used to display in the "STC_Country" control the name of the country displayed in the Country column. This code is entered in the code for displaying a row of BreakHeader:
// Code for displaying the break // Retrieves the subscript of the break (BRK_BreakHeader) BreakSubscript is int = TableBreakSubscript(BRK_BreakHeader) // Fixes the value of the static found in the break TABLE_CUSTOMERS[BreakSubscript].STC_COUNTRY = "Country: " + TABLE_Articles.COL_CountryName
Versions 16 and laterAutomatic calculations in the breaks of a Table control New in version 16Automatic calculations in the breaks of a Table control Automatic calculations in the breaks of a Table control Handling the break headers and footers To initialize the break headers and footers All the break headers and footers can handled:
<Name of break header/footer>..<Property name> = <Value>
Remark: These code lines must be in the event "Displaying a row" of the break header/footer. Example: Code used to modify the height of the break headers:
BreakHeader1..Height += 10
Properties associated with the break headers and footers The following properties are associated with the break headers and footers: | | Collapsed | Allows you to find out and modify the "collapsed" status of a break. | Height | Allows you to find out and modify the height of a break header or footer. | Name | Returns the name of a break header or footer. | Type | Returns the type of an element. | Visible | Allows you to find out whether a break header or footer is visible and to make a break header or footer visible. |
To find out the entire list of available properties, see Properties available for the breaks (Table). WLanguage functions specific to the Table controls with breaks The following functions can be used to handle the breaks in the Table controls:
| | TableBreakSubscript | Returns the subscript of the break header and footer for a given break in a Table control. | TableCollapse | Collapses:- a branch that was previously expanded in a TreeView Table control.
- a break that was previously expanded in a Table control.
- a detailed window displayed for a row.
| TableCollapseAll | Collapses:- the entire hierarchy (all nodes) of a TreeView Table control.
- all breaks of a Table control.
| TableExpand | Expands:- a branch that was previously collapsed in a TreeView Table control.
- a branch that was previously collapsed in a Table control.
- a detailed window displayed for a row.
| TableExpandAll | Expands:- the entire hierarchy (all nodes) of a TreeView Table control.
- all breaks of a Table control.
|
Related Examples:
|
Unit examples (WINDEV): The Table control with break
[ + ] Using the Table control with break.
|
This page is also available for…
|
|
|