ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
  • Equivalence between the TableCount function and the Size property
  • Table controls in "Server + AJAX" mode
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns:
  • the number of columns found in a Table or TreeView Table control.
  • the number of rows found in a Table or TreeView Table control.
Example
// Number of rows found in the "TABLE_Product" control
ResNumberRow = TableCount(TABLE_Product)
Syntax
<Result> = TableCount(<Table control> [, <Row/Column>])
<Result>: Integer
Number of rows or columns found in the specified control.
<Table control>: Control name
Name of the control to be used. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
If this parameter corresponds to an empty string (""), the control to which the current event belongs will be used.
<Row/Column>: Integer constant (optional)
Used to specify the type of returned result:
  • the toShown, toTotal and toVisible constants contain a number of rows.
  • the toColumn constant contains the number of columns in the control.
Table or TreeView Table control based on a data fileTable or TreeView Table control populated programmatically
toShown
WEBDEV - Server code Default constant for a Table or TreeView Table control based on a data file.
WEBDEV - Browser code Constant not available.
Number of non-empty rows visible in the control.
WEBDEV - Server codePHP This constant should not be used for Table controls in "Server + AJAX" mode.
Number of non-empty rows in the visible part of the control.
Remark: Hidden rows (with the Visible property ) are counted.
toColumnNumber of columns found in the control.Number of columns found in the control.
toTotal
(Default value)
WEBDEV - Server codePHP Default constant for a Table control populated programmatically.
  • Total number of records ("Proportional scrollbar" is checked):
    • of the linked file (if there is no filter).
    • filtered of the linked file (if there is a filter).
    • in the query (if the control is linked to a query).
  • Number of visible records if the control includes a scrollbar with an ongoing movement ("Proportional scrollbar" unchecked)Caution: The "end of initialization" code is run when the total is calculated.
WEBDEV - Server code Total number of records:
  • in the linked data file (if there is no filter).
  • filtered of the linked file (if there is a filter).
  • in the query (if the control is linked to a query).
WEBDEV - Server code This calculation may take quite a long time if the control is linked to a huge data file.
Number of rows in memory (rows added by the user or rows added by TableAdd, TableAddLine, TableInsert and TableInsertLine).
Remarks:
  • Hidden rows (with the Visible property ) are counted.
  • Rows filtered with TableEnableFilter or filtered by the user are not counted.
toVisible
WEBDEV - Browser code Constant not available.
Number of visible rows (including the empty rows or the rows that are partially displayed). Corresponds to the maximum number of rows that can be displayed in the control.
WEBDEV - Server codePHP This constant should not be used for Table controls in "Server + AJAX" mode.
Number of visible rows (including the empty rows or the rows that are partially displayed). Corresponds to the maximum number of rows that can be displayed in the control.
Remark: Hidden rows (with the Visible property ) are counted.
Remarks

Use conditions

TableCount can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
    WEBDEV - Server codePHP Reminder: Multi-selection is not available for Table controls in classic mode.
WEBDEV - Server codePHP This function is available for Table controls in "Server" and "Server + AJAX" mode, and for TreeView Table controls.
WEBDEV - Browser code This function is available for Table controls in "Browser" mode only.
WEBDEV - Browser code The TreeView Table control is not available.
WINDEVWEBDEV - Server codeJavaUser code (UMC)PHPAjax

Equivalence between the TableCount function and the Size property

The TableCount function and the Size property are equivalent:
ResNbColumn = TableCount(<Table control>, toColumn)

ResNbColumn = <Table control>.Size
WEBDEV - Server codePHPAjax

Table controls in "Server + AJAX" mode

The value returned by TableCount always corresponds to the number of rows available on the server (for Table controls based on a data file). This value does not necessarily correspond to the data viewed in the Table control in the browser. The changes made by the user on a "Server + AJAX" Table control are applied only on the browser.
Example:
TableCount(TABLE_Ajax_Table, toShown)
// Returns 10 instead of 9
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/10/2023

Send a report | Local help