AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Editores / Editor de reportes / Operaciones en el editor
  • 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
  • Remarks
  • Opening the template associated with a report
  • Applying the modifications performed on a template
  • Testing a report template
  • List of templates used
  • Synchronizing the reports and the report templates
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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 changes made in a report template are automatically applied to all reports using this template.
A report template allows 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.
  • easily update the application style book.
Creating a report template

Creating a report template

To create a report template:
  1. Create a new report template:
    • Click in the quick access buttons.
    • The window for creating a new element appears: click on "Report", then on "Report template".
    • 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 reports that use the template.
  3. Enter (if necessary):
    • the events associated with the report.
    • the events associated with the different controls of the template.
      These events will be automatically imported into the reports that use the template.
  4. Give your template a name ("General" tab of 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 reports that use the report template.
  3. Keep only the code of the events required by the template. These events 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. On the "Inicio" tab, in the "General" group, expand "Guardar" 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:
    • Click in the quick access buttons.
    • The window for creating a new element is displayed: click "Report" then "Report".
    • The report creation wizard starts.
  2. Select the type of report to create. Proceed to the next step of the wizard.
  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 model: the modification will be effective for all reports using this model.
  • in the status with mechanism for "control override": the modification will be effective for the status 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. On the "Modificación" tab, in the "Modelos y plantillas" group, expand "Modelos" 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 override is displayed. In this window, select the properties of the initial report that must be kept. The report template will be automatically overridden for the properties kept. For all the other characteristics, the report will be automatically linked to the template.
  6. Validate.
Note: By default, the orientation characteristics and height of the report and its individual blocks are automatically overridden.

Specific features of blocks

A report contains unique blocks: start of document, top of page, body, bottom of page, end of document, etc.
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

  • Several templates can be applied to a report. In this case, the controls in the different templates are included in the report, as well as the events of these templates. The properties of the report (orientation, height of the blocks, ...) can be linked to a single template only.
  • Templates do not support style overrides.
  • 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 context menu of a template element, select "Open template".
Other possibility:
  1. List the models associated with the report: under the "Modificación" pane, in the "Modelos y plantillas" group, pull down "Modelos" and select "List of models used".
  2. Select the desired template and click "Open template".
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: in the "Modificación" pane, in the "Modelos y plantillas" group, scroll down to "Modelos" and select "Update associated reports".
  • from any report that uses the template, by opening the list of templates used:
    • on the "Modificación" tab, in the "Modelos y plantillas" group, expand "Modelos" and select "List of templates used".
    • click the "Update the selected template" button.
Remark: Model modifications are carried over according to the characteristics overridden in the reports that use the model.
Testing a report template
To run the test of a report template:
  1. Open the report template whose test must be run:
    • click its name in the project explorer.
    • from a report that uses the report template (select "Open template" in the context 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. On the "Modificación" tab, in the "Modelos y plantillas" group, expand "Modelos" and select "List of templates used".
From this window, you can:
  • "Open a model": opens the selected model in the report editor.
  • "Update": fields and template code are updated in the report.
  • "Add": adds a model to the current state.
  • "Disassociate": template fields present in the report are disassociated 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 (fields 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. Open the project description window. To do so, go to the "Proyecto" tab, "Proyecto" group, and click "Descripción".
  2. Go to the "Options" tab of the project description.
  3. Check "Sincronizar modelos durante la generación".
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 05/11/2024

Señalar un error o enviar una sugerencia | Ayuda local