PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Principle of inheritance and overload
  • Overloading the reports
  • Overloading the code of reports
  • Overloading controls
  • Overloading the control style (GUI overload)
  • Overloading the control code (code overload)
  • Specific features of blocks
  • Notes
  • Managing the overloaded properties of a control or block
  • Finding out the overloaded properties
  • Limitations
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
Report templates and inheritance
Overview

Principle of inheritance and overload

When a report template is applied to a report, all the controls and code found in the template are "copied" into the report. This is the concept of inheritance.
The template controls are visible in the report, in the report editor. A yellow square is found in the top left corner of each control. By default, the controls found in the template cannot be modified.
The code of the template is visible in the code editor, in the different processes of the report or report controls. This WLanguage code can be easily identified:
  • the processes associated with the template are followed by "(<Template Name> template)" (for example: "Before printing XXX (MyTemplate template)").
  • the background of the processes is grayed because the code cannot be modified.
For a template of templates, the inheritance is performed on several levels.
You have the ability to overload the controls and the code of the template. Overloading the controls and the code enables you to modify, for a given report, the code and/or the controls of the template.
Overloading the reports

Overloading the code of reports

To overload the code of template reports:
  1. Display the processes of the report ("Code" from the popup menu).
  2. If a process exists in the template report, this process appears twice in the report that is using the template. Indeed, the following elements are displayed:
    • the process issued from the template. This process appears in gray and its caption is followed by "(<Template Name> template)".
    • the process of the report.
  3. The code typed in the process of the report will be run as follows:
    • for all the processes (except for the closing process of the report): the processes of the templates applied to the report are run according to their order of inclusion, then the process corresponding to the report is run.
    • for the closing process of the report: the closing process of the report is run, then the processes of the templates applied to the report are run in reverse order of inclusion.
Note: The local procedures of a report cannot be overloaded in this version.
Overloading controls

Overloading the control style (GUI overload)

To overload the interface of a template control:
  1. Display the popup menu of the template control found in the report.
  2. Select "Overload the control".
  3. The yellow square was replaced by a blue square, indicating that this control can be overloaded.
  4. All the aspects of control interface can now be modified: dimensions, position, style, ...

Overloading the control code (code overload)

To overload the code of a control in the template:
  1. Display the popup menu of a template control found in the report.
  2. Select "Overload the control".
  3. The yellow square was replaced by a blue square, indicating that this control can be overloaded.
  4. Display the button code ("Code" from the popup menu).
  5. Two sections of click code are found:
    • the click code issued from the template.
    • the click code of the report. A function was automatically added: ExecuteAncestor. This function runs the click code of the template.
  6. Add the code specific to the current report, before and/or after the procedure for calling the template code. You have the ability to delete ExecuteAncestor if you do not want the template code to be run.
Note: The local procedures of a report cannot be overloaded.

Specific features of blocks

A report contains unique blocks: start of document, page header, body, page footer, end of document, ...
When a template is inserted into a report, the blocks of same type are automatically merged:
  • the code is automatically inherited (in a cumulative way if several templates are used)
  • the properties are inherited,
  • the block contains the controls found in the template and the ones found in the report.
Only the main template defines the properties of blocks.
Special case: the iteration blocks
The iteration blocks are not unique blocks so they will not be merged.

Notes

  • By default, the different blocks of the report are overloaded. As for the controls, the interface and the code of a block can be overloaded.
  • An overloaded element cannot be deleted from a template.
  • No style overload is available.
Managing the overloaded properties of a control or block

Finding out the overloaded properties

To find out the properties of a control or block that have been overloaded:
  1. Open the popup menu of the control or block.
  2. Select "Overloaded properties".
  3. The window for overload management is opened.
This window allows you to delete the overloaded properties. To do so, select the requested property and delete it.
To entirely delete all the overload operations performed on a control or on a block, all you have to do is select the line named "Full overload".
Limitations
  • The following elements cannot be used in the templates:
    • arrays,
    • breaks,
    • data sources.
  • No style overload is available.
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment