PC SOFT

WINDEV的在线文档

  • 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/footers
  • Properties associated with the break headers and footers
  • WLanguage functions specific to the Table controls with breaks
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
A break in a Table control is used to group rows according to one or more criteria.

For example, you have the ability to group:

  • the customers by country and by city,
  • the products according to their family, ...
16版本和更高版本
WinDev Implementing a total on a break is used to automatically perform a calculation (sum, count, average) for all the rows found in a given break. For example, a total on a break is used to calculate the turnover generated by each customer.
16新版本
WinDev Implementing a total on a break is used to automatically perform a calculation (sum, count, average) for all the rows found in a given break. For example, a total on a break is used to calculate the turnover generated by each customer.
WinDev Implementing a total on a break is used to automatically perform a calculation (sum, count, average) for all the rows found in a given break. For example, a total on a break is used to calculate the turnover generated by each customer.

The breaks in a Table control are available for:
  • the browsing Table controls loaded in memory,
  • the memory Table controls.

20版本和更高版本
WinDev Note: At run time, the user has the ability to store the status of the current breaks in the Table control (collapsed breaks, expanded breaks, ...). See Storing the breaks in the Table/Looper controls (AAF) for more details.
20新版本
WinDev Note: At run time, the user has the ability to store the status of the current breaks in the Table control (collapsed breaks, expanded breaks, ...). See Storing the breaks in the Table/Looper controls (AAF) for more details.
WinDev Note: At run time, the user has the ability to store the status of the current breaks in the Table control (collapsed breaks, expanded breaks, ...). See Storing the breaks in the Table/Looper controls (AAF) for more details.

How to proceed?

Adding a break into a Table control

To add a break into a Table control:
  1. Display the description of the Table control ("Description" from the popup menu).
  2. In the "Content" tab, click. The window for break management is displayed.
    Note: The breaks are not available for the browsing Table controls with direct access.
  3. 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 the 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.
  4. The breaks are performed according to their display order. Modify (if necessary) this order via the arrow buttons found on the right of the table.
  5. 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 "Row display" process. This process 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.

16版本和更高版本
WinDev The sums, means and counts are automatically performed in the breaks of the Table control. The controls found in the break headers and footers can display these calculations. See Automatic calculations in the table breaks for more details.
16新版本
WinDev The sums, means and counts are automatically performed in the breaks of the Table control. The controls found in the break headers and footers can display these calculations. See Automatic calculations in the table breaks for more details.
WinDev The sums, means and counts are automatically performed in the breaks of the Table control. The controls found in the break headers and footers can display these calculations. See Automatic calculations in the table breaks for more details.

Notes:
  • WinDev In the description of the Table control ("Content" tab), you have the ability to specify whether the breaks must display (or not) a button used to collapse/expand the break ("Breaks with collapse/expand").
  • 15版本和更高版本
    WinDev In the description of the Table control, you have the ability to configure the image used to draw the + and - buttons in the table breaks. To do so, select the "Break, border in creation" element in the "Style" table then click the "Plus/Minus image of breaks" button.
    15新版本
    WinDev In the description of the Table control, you have the ability to configure the image used to draw the + and - buttons in the table breaks. To do so, select the "Break, border in creation" element in the "Style" table then click the "Plus/Minus image of breaks" button.
    WinDev In the description of the Table control, you have the ability to configure the image used to draw the + and - buttons in the table breaks. To do so, select the "Break, border in creation" element in the "Style" table then click the "Plus/Minus image of breaks" button.
  • 18版本和更高版本
    WinDev A break header can be always visible. In this case, during the scroll, the bar of the break will not be moved. In order for a break header to be always visible:
    • Select the break header and display its description ("Description" from the popup menu).
    • In the "GUI" tab, check "Break header always visible".
    18新版本
    WinDev A break header can be always visible. In this case, during the scroll, the bar of the break will not be moved. In order for a break header to be always visible:
    • Select the break header and display its description ("Description" from the popup menu).
    • In the "GUI" tab, check "Break header always visible".
    WinDev A break header can be always visible. In this case, during the scroll, the bar of the break will not be moved. In order for a break header to be always visible:
    • Select the break header and display its description ("Description" from the popup menu).
    • In the "GUI" tab, check "Break header always visible".

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 additions of data are performed by 表格添加行. In order for a Table control to be sorted according to the specified breaks, you must use 表格数据排序.

Example: Memory Table control: A break was defined on the Country and City columns:

// Fill the Table control
表格添加行TABLE_Breaks"FRANCE""Montpellier""TEXT1""Text1"
表格添加行TABLE_Breaks"FRANCE""Paris""TEXT2""Text2"
表格添加行TABLE_Breaks"FRANCE""Montpellier""TEXT3""Text3"
表格添加行TABLE_Breaks"FRANCE""Lille""TEXT4""Text4"

表格添加行TABLE_Breaks"SPAIN""Madrid""TEXT1""Text1"
表格添加行TABLE_Breaks"SPAIN""Barcelona""TEXT3""Text3"
表格添加行TABLE_Breaks"SPAIN""Barcelona""TEXT4""Text4"

表格添加行TABLE_Breaks"ALGERIA""Alger""TEXT5""Text5"
表格添加行TABLE_Breaks"ALGERIA""Oran""TEXT6""Text6"
表格添加行TABLE_Breaks"ALGERIA""Alger""TEXT7""Text7"
表格添加行TABLE_Breaks"ALGERIA""Chlef""TEXT8""Text8"
表格添加行TABLE_Breaks"ALGERIA""Alger""TEXT9""Text9"

表格添加行TABLE_Breaks"SPAIN""Madrid""TEXT2""Text2"

// Sort the content of the Table control according to the breaks
表格数据排序TABLE_BreaksTABLE_Breaks.Country..名称,TABLE_Breaks.City..名称)

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.
Note: These code lines must be found in the "Row display" process of the break header and footer.

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整数型表格分隔条下标BRK_BreakHeader

// Fixes the value of the static found in the break
TABLE_CUSTOMERSBreakSubscript】.STC_COUNTRY"Country: "+TABLE_Articles.COL_CountryName

16版本和更高版本
Automatic calculations in the breaks of a Table control
WinDev
You have the ability to perform automatic calculations (sum, count and average) in the break headers and footers.

To implement the automatic calculations:

  1. Insert a Static control or an edit control into the break header and footer. This control will contain the automatic calculation.
  2. Display the description window of the control ("Description" from the popup menu).
  3. In the "GUI" tab, in the "In a break, display" area, click the "No calculation" link or click the description of the calculation (if an automatic calculation was already defined). The description window of an automatic calculation is displayed.
  4. Select the calculation to perform. You can choose:
    • "The sum of": the control will display the sum per break.
    • "The average of": the control will display the average on the break.
    • "The number (count) of": the control will count the number of elements per break.
  5. Select the element on which the calculation must be performed. You have the ability to perform the calculation on a column of the Table control.
  6. Validate the different windows.
Tips:
  • Don't forget to modify the input mask of the control that displays the calculation according to the type of calculated information.
  • Don't hesitate to use the "eye magnet" technology on the edit controls that display calculations in the breaks. This gives you the ability you to highlight a calculation (displaying an insufficient turnover in red for example).
16新版本
Automatic calculations in the breaks of a Table control
WinDev
You have the ability to perform automatic calculations (sum, count and average) in the break headers and footers.

To implement the automatic calculations:

  1. Insert a Static control or an edit control into the break header and footer. This control will contain the automatic calculation.
  2. Display the description window of the control ("Description" from the popup menu).
  3. In the "GUI" tab, in the "In a break, display" area, click the "No calculation" link or click the description of the calculation (if an automatic calculation was already defined). The description window of an automatic calculation is displayed.
  4. Select the calculation to perform. You can choose:
    • "The sum of": the control will display the sum per break.
    • "The average of": the control will display the average on the break.
    • "The number (count) of": the control will count the number of elements per break.
  5. Select the element on which the calculation must be performed. You have the ability to perform the calculation on a column of the Table control.
  6. Validate the different windows.
Tips:
  • Don't forget to modify the input mask of the control that displays the calculation according to the type of calculated information.
  • Don't hesitate to use the "eye magnet" technology on the edit controls that display calculations in the breaks. This gives you the ability you to highlight a calculation (displaying an insufficient turnover in red for example).
Automatic calculations in the breaks of a Table control
WinDev
You have the ability to perform automatic calculations (sum, count and average) in the break headers and footers.

To implement the automatic calculations:

  1. Insert a Static control or an edit control into the break header and footer. This control will contain the automatic calculation.
  2. Display the description window of the control ("Description" from the popup menu).
  3. In the "GUI" tab, in the "In a break, display" area, click the "No calculation" link or click the description of the calculation (if an automatic calculation was already defined). The description window of an automatic calculation is displayed.
  4. Select the calculation to perform. You can choose:
    • "The sum of": the control will display the sum per break.
    • "The average of": the control will display the average on the break.
    • "The number (count) of": the control will count the number of elements per break.
  5. Select the element on which the calculation must be performed. You have the ability to perform the calculation on a column of the Table control.
  6. Validate the different windows.
Tips:
  • Don't forget to modify the input mask of the control that displays the calculation according to the type of calculated information.
  • Don't hesitate to use the "eye magnet" technology on the edit controls that display calculations in the breaks. This gives you the ability you to highlight a calculation (displaying an insufficient turnover in red for example).

Handling the break headers and footers

To initialize the break headers/footers

All the break headers and footers can handled:

<Name of Break Header/Footer>..<Property Name> = <Value>

Note: These code lines must be found in the "Row display" process of the break header and footer.

Example: Code used to modify the height of the break headers:

BreakHeader1..高度+=10

Properties associated with the break headers and footers

The following properties are associated with the break headers and footers:
收起Used to find out and modify the "collapsed" status of a break.
高度Used to find out and modify the height of a break header or footer.
名称Returns the name of a break header or footer.
类型Returns the type of an element.
可见Used to find out whether a break header or footer is visible and to make a break header or footer visible.

WLanguage functions specific to the Table controls with breaks
The following functions can be used to handle the breaks in the Table controls:
11版本和更高版本
表格展开
11新版本
表格展开
表格展开
Expands:
  • a branch that was previously collapsed in a TreeView Table control.
  • a branch that was previously collapsed in a Table control.
11版本和更高版本
表格展开全部
表格展开全部
Expands:
  • the entire hierarchy (all the nodes) of a TreeView Table control.
  • all the breaks of a Table control.
11版本和更高版本
表格收起
11新版本
表格收起
表格收起
Collapses:
  • a branch that was previously expanded in a TreeView Table control.
  • a break that was previously expanded in a Table control.
11版本和更高版本
表格收起全部
表格收起全部
Collapses:
  • the entire hierarchy (all the nodes) of a TreeView Table control.
  • all the breaks of a Table control.
15版本和更高版本
表格分隔条下标
表格分隔条下标
Returns the subscript of the break header and footer for a given break in a Table control.