ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Spreadsheet functions
  • Available masks
  • Defining a mask on a column
  • Miscellaneous
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 or modifies the type and the mask of selected cells in a Spreadsheet control found in a window.
Remark: This function can be used for example to create a formatting bar for a Spreadsheet control.
Example
// CLICK on [NUMBER] - Change of mask
SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet, typInputNum, "999 999 999,99")
 
// CLIC on [Long DATE].
// Change of mask: for example 19 -> "Sunday 19 January 1900"
SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet, typInputDate, "DDD D MMMM YYYY")
// Returns the selection mask
sRes is string
nType is int
sMask is string
sRes = SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet)
nType = Val(ExtractString(sRes, 1, TAB))
sMask = Val(ExtractString(sRes, 2, TAB))
Syntax

Finding out the type and mask of selected cells Hide the details

<Result> = SpreadsheetTypeAndMaskSelection(<Spreadsheet control>)
<Result>: Character string
Mask of selected cells. This mask has the following format:
<Type> + TAB + <Mask>
where:
  • <Type> corresponds to one of the following constants:
    typInputCurrencyCurrency type
    typInputDateDate type
    typInputDurationDuration type
    typInputNumNumeric type (integer, real, ...)
    typInputTextText type
    typInputTimeTime type
  • <Mask> corresponds to the mask used.
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.

Modifying the type and mask of selected cells Hide the details

SpreadsheetTypeAndMaskSelection(<Spreadsheet control> , <Type> , <Mask>)
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.
<Type>: Integer constant
New type for the selected cell:
typInputCurrencyCurrency type
typInputDateDate type
typInputDurationDuration type
typInputNumNumeric type (integer, real, ...)
typInputTextText type
typInputTimeTime type
<Mask>: Character string
New mask to use (the mask depends on the selected type).
Remarks

Available masks

The available masks depend on the type of mask. All masks that can be used with InputMask are available. For more details, see the help on the InputMask property.
For example:
  • on a date: you have the ability to use the "DD/MM/YYYY" mask.
  • on a numeric: you have the ability to use the "999 999" mask.
Remarks:
  • (typInputText, "") means "no mask".
  • The mask defined by SpreadsheetTypeAndMaskSelection can be modified by InputMask.
    Caution: only the mask can be modified, the type of cell is not modified.

Defining a mask on a column

To define a mask on a column, all you have to do is select the column and apply the requested mask. Example:
SpreadsheetSelectPlus(PSHEET_NoName1, "A")
SpreadsheetTypeAndMaskSelection(PSHEET_NoName1, typInputDate, "DD-MM-YY")

Miscellaneous

  • The modify operation is added into the list of operations to cancel: the user can undo this operation via the context menu or by pressing Ctrl + Z.
  • This function can only be used on a Spreadsheet control found in a window.
Related Examples:
The Spreadsheet control Unit examples (WINDEV): The Spreadsheet control
[ + ] Using the Spreadsheet control.
This example explains how to:
- load an xlsx file in a spreadsheet control,
- save the spreadsheet in a file,
- fill the control with data coming from the database,
- insert rows, columns,
- access the cells and handle them (modify their value, their style, ...),
- enter formulas,
- ...
Component: wd290obj.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help