PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
SpreadsheetAllowProcedure (Function)
In French: TableurAutoriseProcédure
Allows the use of a WLanguage procedure in a formula of a Spreadsheet control.
Note: By default, the WLanguage procedures are not allowed in the formulas for security reasons. Indeed, a malicious user could for example call an initialization procedure that resets all data files to 0.
Example
// Allows the CalculateVAT() procedure in the formulas
SpreadsheetAllowProcedure(PSHEET_Spreadsheet, "CalculateVAT" + CR + "MaxPrice" + CR + "MinPrice")
SpreadsheetAddFormula(PSHEET_Spreadsheet, 1,1, "CalculateVAT(C2)")
SpreadsheetAddFormula(PSHEET_Spreadsheet, 2,1, "(MaxPrice() + MinPrice())/2")
Syntax
SpreadsheetAllowProcedure(<Spreadsheet Control> , <Procedure Name>)
<Spreadsheet Control>: Control name
Name of Spreadsheet control to use.
<Procedure Name>: Character string (with or without quotes)
Name of the WLanguage procedure that is allowed in a formula. This procedure can be a local or global procedure.
To specify several procedures, the names must be separated by a CR character (Carriage Return).
This procedure must return the value to display in the cell using the formula.
Remarks
  • Caution: If a WLanguage procedure is allowed, this procedure will be displayed in the list of formulas proposed to the user. Therefore, the end user will be able to use this procedure. Don't forget to provide a documentation about the possible formulas and expected parameters.
  • 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,
- ...
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment