PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Creating a report template
  • Creating a report template
  • Creating a report template from an existing report
  • Applying a report template
  • Creating a new report based on a report template
  • Applying a template to an existing report
  • Specific features of blocks
  • Notes
  • Opening the template associated with a report
  • Applying the modifications performed on a template
  • Running the test of a report template
  • List of templates used
  • Synchronizing the reports and the report templates
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
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to create report templates. These templates contain the graphic elements and the code common to all the reports of your application.
The modifications performed in a report template are automatically applied to all the reports that use this template.
A report template enables you to comply with the style book defined for an application.
Using report templates in your applications allows you to:
  • simplify the creation of reports in the application.
  • simplify the layout of reports in the application.
  • simplify the update of the style book defined for the application.
Creating a report template

Creating a report template

To create a report template:
  1. Create a new report template ("File ..New .. Report .. Report template"). The report editor displays a new report inside a green border named "Report template".Create a new report template:
    • Click among the quick access buttons.
    • In the wheel that is displayed, hover "Report" and click "Report templates". The window for creating a new element is displayed: click "Report" then "Report templates".
    • The report editor displays a new report inside a green border named "Report template".
  2. Create all the necessary controls. These controls will be included in all the reports that use the template.
  3. Enter (if necessary):
    • the processes associated with the report.
    • the processes associated with the controls found in the template.
      These processes will be automatically imported into the reports that use the template.
  4. Give a name to your template ("General" tab in the description window).
  5. Save the report template ( or CTRL + S).
The report template corresponds to a file whose extension is ".WTE".

Creating a report template from an existing report

To create a report template from an existing report:
  1. Open the report that will be used as template.
  2. Keep the controls required by the template. These controls will be included in all the reports that use the report template.
  3. Keep the code of processes required by the template. These processes will be automatically imported into the reports that use the template.
  4. Give a name to your report if necessary ("General" tab in the description window).
  5. Select "File .. Save as template". On the "Home" pane, in the "General" group, expand "Save" and select "Save as template".
The current report becomes a template:
  • its name is preceded by "Template".
  • a green border appears around the report in the report editor.
  • the report template is displayed in the "Project explorer" pane in the "Report templates" folder.
The report template corresponds to a file whose extension is ".WTE".
Applying a report template

Creating a new report based on a report template

To create a new report based on a report template:
  1. Create a new report ("File .. New .. Report"). The wizard for report creation starts. Create a new report:
    • Click among the quick access buttons.
    • Click "Report" in the wheel that is displayed. The window for creating a new element is displayed: click "Report" then "Report".
    • The wizard for report creation starts.
  2. Select the type of report to create. Go to the next wizard step.
  3. Choose your template from the list of available templates.
  4. End the wizard and validate. The new report is displayed in the editor.
A yellow square is used to identify the elements belonging to the report template. These elements can be modified:
  • in the report template: the modification will be effective for all the reports that use this template.
  • in the report by the mechanism for "control overload": the modification will be effective for the report only.

Applying a template to an existing report

To apply a template to an existing report:
  1. Display the report in the report editor.
  2. Select "Insert .. A template (Inheritance)".On the "Modification" pane, in the "Templates and skin template" group, expand "Templates" and select "Inherit from a template".
  3. Select the report template to apply.
  4. Validate.
  5. Specify whether the report properties must be updated from the template. If you answer "Yes", the list of properties to overload is displayed. In this window, select the properties of the initial report that must be kept. The report template will be automatically overloaded for the properties kept. For all the other characteristics, the report will be automatically linked to the template.
  6. Validate.
Note: By default, the characteristics regarding the orientation and the height of the report (and report blocks) are automatically 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

  • Several templates can be applied to a report. In this case, the controls found in the different templates are included in the report, as well as the processes of these templates. The properties of the report (orientation, height of the blocks, ...) can be linked to a single template only.
  • No style overload is supported by the templates.
  • The following elements cannot be used in the templates:
    • arrays,
    • breaks,
    • data sources.
Opening the template associated with a report
To open the template associated with a report:
  1. Display the report in the report editor.
  2. In the popup menu of a template element, select "Open the template".
Other possibility:
  1. List the templates associated with the report ("Report .. List of templates used"). List the templates associated with the report: on the "Modification" pane, in the "Templates and skin template" group, expand "Templates" and select "List of templates used".
  2. Select the requested template and click the "Open the template" button.
Applying the modifications performed on a template
When a report template is modified, the modifications can be applied to one ore more reports that use this template in the current project.
Applying the modifications is proposed when the template is saved.
It can also be performed at any time:
  • from the template, via "Report .. Update the associated reports".from the template: on the "Modification" pane, in the "Templates and skin template" group, expand "Templates" and select "Update the associated reports".
  • from any report that is using the template, by opening the list of templates used ("Report .. List of templates used") and by clicking the "Update" button.from any report that is using the template, by opening the list of templates used:
    • on the "Modification" pane, in the "Templates and skin template" group, expand "Templates" and select "List of templates used".
    • click the "Update the selected template" button.
Note: The modifications made to the template are applied according to the overloaded characteristics of the reports that use the template.
Running the test of a report template
To run the test of a report template:
  1. Open the report template whose test must be run ("Report .. List of templates used", "Open the template" button).Open the report template whose test must be run:
    • click its name in the project explorer.
    • from a report that is using the report template (select "Open the template" from the popup menu of one of the controls for example).
  2. Click .
List of templates used
To display the list of templates used for a report:
  1. Open the requested report in the report editor.
  2. Select "Report .. List of templates used".On the "Modification" pane, in the "Templates and skin template" group, expand "Templates" and select "List of templates used".
From this window, you can:
  • "Open a template": opens the selected template in the report editor.
  • "Update": the controls and the code of the template are updated in the report.
  • "Add": adds a template to the current report.
  • "Dissociate": the template controls found in the report are dissociated from the template. The template is deleted from the list of templates used but its controls are not deleted from the report.
  • "Delete": deletes the template (controls and code) from the report.
Synchronizing the reports and the report templates
The reports and their templates can be synchronized when creating the executables, components, ...
  1. Display the description window of project ("Project .. Project description"). Display the description window of project: on the "Project" pane, in the "Project" group, click "Description".
  2. Display the "Options" tab of the project description.
  3. Check "Synchronize the windows and the reports according to their templates when generating executables, libraries, components, ...".
Related Examples:
WD Reports Training (WINDEV): WD Reports
[ + ] This example presents the different methods for creating a report:

- prints based on different data sources (queries, variables, ...)
- prints based on controls (Table, Spreadsheet, PVT, ...)
- printing composite reports
- specific prints (portrait/landscape, report with watermark, report with bar code, ...)
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment