ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Pivot Table functions
  • Saving and loading a Pivot Table control
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Saves the result of the calculation performed in a Pivot Table control (in a file or in memory). This result can be loaded again in a Pivot Table control using <Pivot Table>.Load.
Subscription-exclusive new feature
WEBDEV - Server codeLinux This function is now available for WEBDEV websites in Windows and Linux.
Note: This feature is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 4.
For more details, see Using new features exclusive to the subscription-based version of WINDEV Suite 2025.
Example
sFile is string
// Builds the file name
sFile = SysDir(srAppData) + ["\"] + "StatsByCountry.tcd"

// The file exists?
IF fFileExist(sFile) THEN
	// Yes, load it 
	PVT_Statistics.Load(sFile)
	IF YesNo("Do you want to recalculate all?") THEN PVT_Statistics.CalculateAll()
ELSE
	// The file does not exist. It is going to be calculated
	PVT_Statistics.CalculateAll()
END
PVT_Statistics.Save(sFile)
Syntax

Saving a Pivot Table control with its interface and a password Hide the details

<Result> = <Pivot Table control>.Save(<Save destination> [, <Save mode> [, <Password>]])
<Result>: Type according to save destination
  • Memory: Buffer containing the result. This result can be then saved in a file (using fSaveBuffer), etc.
  • File:
    • True if saved successfully,
    • False otherwise.
<Pivot Table control>: Control name
Name of the Pivot Table control to be used.
<Save destination>: Character string or constant
  • To save the contents of the Pivot Table control to memory, use the inMemory constant. <Result> contains the result.
  • To save the Pivot Table control as a file, specify the name and full path of the file.
<Save mode>: Optional Integer constant
By default, only the data is saved. You can also save the Pivot Table control interface:
pvtWithUISaves the configuration of the Pivot Table control:
  • size of columns,
  • size of rows,
  • collapsed/expanded row headers or column headers.
Note: Before version 25, this constant was named pvtWithGUI.
If <Save mode> and <Password> are not specified, only the data in the Pivot Table control will be saved and the result will not be password protected. To save the data only and password-protect the result, use syntax 2.
<Password>: Optional string or Secret string
Result password. If the result is password protected, the password must be specified when <Pivot Table>.Load is used.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.

Saving a Pivot Table control without its interface and with a password Hide the details

<Result> = <Pivot Table control>.Save(<Save destination> [, <Password>])
<Result>: Type according to save destination
  • Memory: Buffer containing the result. This result can be then saved in a file (using fSaveBuffer).
  • File:
    • True if saved successfully,
    • False otherwise.
<Pivot Table control>: Control name
Name of the Pivot Table control to be used.
<Save destination>: Character string or constant
  • To save the contents of the Pivot Table control to memory, use the inMemory constant. <Result> contains the result.
  • To save the Pivot Table control as a file, specify the name and full path of the file.
<Password>: Optional string or Secret string
Result password. If the result is password protected, the password must be specified when <Pivot Table>.Load is used.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Remarks

Saving and loading a Pivot Table control

When the content of a Pivot Table control is calculated with <Pivot table>.CalculateAll, the result can be saved with <Pivot Table>.Save. Then, it can be loaded again using <Pivot Table>.Load. In this case, the content of the Pivot Table control is not recalculated.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/07/2025

Send a report | Local help