ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Table Column control
  • When are automatic calculations performed?
  • Recover the value of an automation calculation
  • Modify the characteristics of automation calculations (by programming)
  • Properties that can be used on the calculation cells of columns
  • Exporting the results of automation calculations
  • Export via the AAF (Automatic Application Features) of Table control
  • Export via the WLanguage functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
When are automatic calculations performed?
The calculations are performed:
  • when initializing the Table control.
  • when a process performs an addition or modification in a Table control with calculations:
    • the totals are re-calculated at the end of process (or when using Multitask).
    • if the value of a calculation is requested (see next paragraph), the calculation is instantly rerun.
TotalsEnabled is used to forbid or force the calculations performed in a Table control.
Attention: If the DisplayEnabled property is used on the Table field and corresponds to Faux, automatic calculations are not updated..
Recover the value of an automation calculation
The results of the various automatic calculations performed in a Table field can be manipulated programmatically.
Several constants are used to identify the calculation row of a column:
rowAverageRow containing the result of a mean.
rowCountRow containing the result of the count.
rowMaximumRow containing the maximum value of column cells.
rowMinimumRow containing the minimum value of column cells.
rowTotalRow containing the result of a total.

To retrieve the value of a calculation, use the following syntax:
<Nom de la colonne>[<Type du calcul>]

Example:
// Récupère le calcul de moyenne effectué dans la colonne COL_NOTE
Trace(COL_NOTE[rowAverage])
Modify the characteristics of automation calculations (by programming)
WINDEV allows you to modify the characteristics (font, color, etc.) of a column's output using WLanguage properties.. For example, you can use WLanguage properties to modify the color of the result, its background color, font, etc.. However, the content of result cell cannot be modified programmatically.
To use a WLanguage property on the result of a column, the following syntax must be used:
<Nom de la colonne>[<Type du calcul>].<Propriété>

Example:
// Colore en rouge le résultat de la moyenne. Le fond est en bleu
COL_NOTE[rowAverage].Couleur = LightRed
COL_NOTE[rowAverage].CouleurFond = LightBlue

Properties that can be used on the calculation cells of columns

BackgroundColorUsed to find out and modify the background color of a calculation cell.
CaptionUsed to find out and modify the caption of the row containing a calculation cell.
ColorUsed to find out and modify the color of the text displayed in a calculation cell.
FontAllows you to find out and modify the font used in a calculation cell.
FontBoldUsed to find out and modify the "Bold" attribute for the column elements.
FontCondensedUsed to find out whether the characters of column elements are condensed or not, and to condense (or not) the characters of column elements.
FontExtendedUsed to find out whether the characters of column elements are extended or not, and to extend (or not) the characters of column elements.
FontItalicUsed to find out and modify the "Italic" attribute for the column elements.
FontLargeUsed to find out whether the characters of column elements are enlarged or not, and to enlarge (or not) the characters of column elements.
FontNameUsed to find out and modify the font used for the column elements.
FontSizeUsed to find out and modify the size of the font used for the column elements.
FontStrikeOutUsed to find out and modify the "StrikeOut" attribute for a calculation cell.
FontUnderlinedUsed to find out and modify the "Underline" attribute for the column elements.
HeightUsed to find out and modify the height of a calculation cell.
NameUsed to find out the name of a calculation cell.
NoteUsed to find out and modify the notes associated with a calculation cell.
StateGets and changes the display state of the row containing the calculation cell.
VisibleUsed to find out whether a column is visible and to make a column visible/invisible.
WidthUsed to find out and modify the width of a calculation cell.
Exporting the results of automation calculations
WINDEVWindows

Export via the AAF (Automatic Application Features) of Table control

The context menu of Table and TreeView Table controls contains several options to export the control content.
During this export, the results of automatic calculations are exported.
Remarks:
  • Only the value is exported, not the caption.
  • During the export in Excel, the cell corresponding to the calculation contains the corresponding Excel formula.

Export via the WLanguage functions

Various WLanguage functions can be used to export the contents of a Table field in a specific format (Word, Excel, XML, etc.).. During this export, the rows corresponding to calculations are also exported by default.
To avoid exporting the calculation rows, all you have to do is specify the taNoTotal constant in the following functions:
<Table>.ToClipboardCopies the content of a Table or TreeView Table control to the clipboard.
<Table>.ToExcelCreates an Excel file with the data from a Table or TreeView Table control.
<Table>.ToTextCreates a character string from the data found in a Table or TreeView Table control.
<Table>.ToWordCreates a Word file (.RTF) from the data found in a Table or TreeView Table control.
<Table>.ToXMLCreates an XML file from the data found in a Table or TreeView Table control.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help