ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Spreadsheet control
  • Overview
  • Initializing a Spreadsheet control in a report
  • Properties specific to the management of Spreadsheet control in a report
  • "Before printing cell" process
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
Handling Spreadsheet controls programmatically (in a report)
Overview
A Spreadsheet control found in a report can be handled through programming.
  • If the Spreadsheet control is linked to no data, it can be initialized through programming.
  • Several properties can be used to manage a Spreadsheet control in a report.
  • The "Before printing cell" process is used to modify the cells of the Spreadsheet control.
Remarks:
  • No cell can be created during the print. The print must be performed from the Spreadsheet control found in a window or from an Excel document.
  • The height and width of the cells, rows or columns cannot be modified.
Initializing a Spreadsheet control in a report
To initialize a Spreadsheet control found in a report through programming, all you have to do is assign the Excel file to the control (in the opening process of the report or in the initialization process of the control for example).
<Name_Spreadsheet_control> = <File name>
For example:
PSHEET_Statistics = "Show2015.xlsx"
Properties specific to the management of Spreadsheet control in a report
The following properties are used to manage the Spreadsheet controls in the reports:
AdjustmentModeThe AdjustmentMode property determines and changes how a Spreadsheet control is adjusted in a report.
GridlinesVisibleThe GridlinesVisible property is used to:
  • Determine whether or not gridlines are visible in a control.
  • Show or hide gridlines in a control.
PrintAreaThe PrintArea property is used to get and change the print area of a Spreadsheet control in a report.
PrintedSheetWithin a report, the PrintedSheet property is used to get and change the sheet of a Spreadsheet control to be printed.
For a complete list of WLanguage properties that can be used with a Spreadsheet control and with its cells, see Spreadsheet control properties
"Before printing cell" process
The "Before printing cell" process is a process associated with the Spreadsheet control in the reports.
This process is used to customize the characteristics of the cells found in the Spreadsheet control.
You can use:
  • the MySelf keyword to get the name of the current cell.
  • the MySelf[MySelf] syntax to get the content of the cell.
Tip: MySelf[MySelf] corresponds to an xlsCell variable. All the properties of this variable type can be used and they allow you to modify the characteristics of the cell.
Example:
MyFont is Font
MyFont.Name = "Comic Sans MS"
MyFont.Size = 10
MyFont.Bold = True
MyFont.Underline = True
MyFont.Color = PastelBlue
 
ABorder is Border
ABorder.Line = LineDotAndDash
ABorder.Thickness = 1
ABorder.Edges = BorderAll
 
IF MySelf [= "B" THEN
MySelf[MySelf].BackgroundColor = PastelOrange
IF Right(MySelf[MySelf],1) = 8 THEN
MySelf[MySelf].Font = MyFont
END
IF Right(MySelf[MySelf],1) = 6 THEN
MySelf[MySelf].Border = ABorder
END
IF Right(MySelf[MySelf],1) = 2 THEN
MySelf[MySelf].Value = "RESET"
MySelf[MySelf].Font.Color = Black
MySelf[MySelf].Font.Size = 13
END
END
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help