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
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
Saves the result of the calculation performed in a Pivot Table control (in a file or in memory). This backup can be reloaded in a Pivot Table control by PVTLoad.
Example
sFile is string
// Builds the file name
sFile = SysDir(srAppData) + ["\"] + "StatsByCountry.tcd"
 
// The file exists?
IF fFileExist(sFile) THEN
// Yes, load it
PVTLoad(PVT_Statistics, sFile)
IF YesNo("Do you want to recalculate everything?") THEN PVTCalculateAll(PVT_Statistics)
ELSE
// The file does not exist, calculate it
PVTCalculateAll(PVT_Statistics)
END
PVTSave(PVT_Statistics, sFile)
Syntax

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

<Result> = PVTSave(<Pivot Table control> , <Backup media> [, <Backup mode> [, <Password>]])
<Result>: Type depending on the backup media
  • Backup in memory: Buffer containing the backup. Then, this backup can be saved in a file (fSaveBuffer), ...
  • Backup in a file:
    • True if the backup was performed,
    • False otherwise.
<Pivot Table control>: Control name
Name of the Pivot Table control to be used.
<Backup media>: Character string or constant
  • Backup in memory: inMemory constant: Saves the content of the Pivot Table control in memory. <Resultat> contains the backup result.
  • Backup in a file: Name and full path of the file where the content of Pivot Table control will be saved.
<Backup mode>: Optional Integer constant
By default, only the data is saved. You also have the ability to save the interface of Pivot Table control:
pvtWithUISaves the configuration of Pivot Table control:
  • size of columns,
  • size of rows,
  • collapsed/expanded row headers or column headers.
Remark: Prior to version 25, this constant was called pvtWithGUI.
If <Backup mode> and <Password> are not specified, only the found in the Pivot Table control will be saved and the backup will not be password protected. To save the data only and to protect the backup by a password, use the syntax 2.
<Password>: Optional character string
Backup password. If the backup is password protected, this password will have to be specified when the backup is loaded by PVTLoad.

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

<Result> = PVTSave(<Pivot Table control> , <Backup media> [, <Password>])
<Result>: Type depending on the backup media
  • Backup in memory: Buffer containing the backup. Then, this backup can be saved in a file (fSaveBuffer), ...
  • Backup in a file:
    • True if the backup was performed,
    • False otherwise.
<Pivot Table control>: Control name
Name of the Pivot Table control to be used.
<Backup media>: Character string or constant
  • Backup in memory: inMemory constant: Saves the content of the Pivot Table control in memory. <Resultat> contains the backup result.
  • Backup in a file: Name and full path of the file where the content of Pivot Table control will be saved.
<Password>: Optional character string
Backup password. If the backup is password protected, this password will have to be specified when the backup is loaded by PVTLoad.
Remarks

Saving and loading a Pivot Table control

When the content of a Pivot Table control is calculated with PVTCalculateAll, the result can be saved with PVTSave. Then, it can be loaded again using PVTLoad: in this case, the content of the Pivot Table control is not recalculated.
Business / UI classification: UI Code
Component: wd290obj.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/04/2023

Send a report | Local help