ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Report editor / Operations in the editor
  • Overview
  • Principle of inheritance and override
  • Overriding the reports
  • Overriding the code of reports
  • Overriding controls
  • Overriding the control style (UI override)
  • Overriding the control code (code override)
  • Specific features of blocks
  • Remarks
  • Managing the overridden properties of a control or block
  • Finding out the overridden properties
  • Limitations
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
Report templates and inheritance
Overview

Principle of inheritance and override

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 upper-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 can override the controls and the code of the template. Overriding controls and code allows you to modify, for a given report, the code and/or the controls of the template.
Overriding the reports

Overriding the code of reports

To override the code of template reports:
  1. Open the events associated with the report (select "Code" in the context menu).
  2. If an event exists in the template report, this event appears twice in the report that uses the template. Indeed, the following elements are displayed:
    • the event from the template. This event appears in gray and its caption is followed by "(<Template name> template)".
    • the event associated with the report.
  3. The code written in the event associated to the report will be run as follows:
    • for all events (except the "Close" event of the report): the events of the templates applied to the report are run according to their order of inclusion, then the event associated with the report is run.
    • for the "Close" event of the report: the "Close" event of the report is run, then the events of templates applied to the report are run in the reverse order in which they were included.
Remark: The local procedures of a report cannot be overridden in this version.
Overriding controls

Overriding the control style (UI override)

To override the interface of a template control:
  1. Display the popup menu of the template control found in the report.
  2. Select "Override control".
  3. The yellow square was replaced with a blue square, indicating that this control can be overridden.
  4. You can change all the aspects of the control interface: dimensions, position, style, etc.

Overriding the control code (code override)

To override the code of a control in the template:
  1. Display the popup menu of a template control found in the report.
  2. Select "Override control".
  3. The yellow square was replaced with a blue square, indicating that this control can be overridden.
  4. Display the button code ("Code" in the context 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.
Remark: The local procedures of a report cannot be overridden.

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: iteration blocks
The iteration blocks are not unique blocks so they will not be merged.

Remarks

  • By default, the different blocks of the report are overridden. As with controls, the interface and the code of a block can be overridden.
  • An overridden element cannot be deleted from a template.
  • Style override is not available.
Managing the overridden properties of a control or block

Finding out the overridden properties

To find out the properties of a control or block that have been overridden:
  1. Open the popup menu of the control or block.
  2. Select "Overridden properties".
  3. The override management window opens.
This window allows you to delete overridden properties. To do so, select the requested property and delete it.
To delete all the overrides performed on a control or block, simply select "Full override".
Limitations
  • The following elements cannot be used in the templates:
    • arrays,
    • breaks,
    • data sources.
  • Style override is not available.
See also
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/05/2023

Send a report | Local help