ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Editors / Report editor / Data sources
  • Overview
  • Characteristics the report based on a Table control
  • Creating a report based on a Table control from the window editor
  • Creating a report automatically and a button used to print the report
  • Characteristics of the new report based on a Table control
  • Creating a report based on a Table control from the report editor
  • Creating a report based on a Table control from the report editor
  • Printing a report based on a Table control
  • Printing a report based on a Table control
  • WINDEV example
  • WEBDEV example
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Report based on a Table control
Overview
The report on a Table control allows you to directly print the information displayed in a Table control (linked to data, programmatically or on a variable) present:
  • in a window or page of the application. This window or page must be displayed when printing the report.
  • in a window or in an internal page. The window (or the page) that displays the internal window (or the internal page) must be displayed.
Reports & Queries cannot be used to create reports on Table control. However, it is possible to customize reports on a Table control created using the built-in report editor (color, font, size, etc.).
A report based on a Table control can print:
  • all rows displayed in the Table control (ability to filter the data found in the Table control with the magnifier).
  • the rows selected by the user (for the multi-selection Table controls where the rows are selected with the Ctrl key). This option is not available in WEBDEV.
Characteristics the report based on a Table control
If the report is based on a Table control:
  • Each row in the Table control corresponds to a record.
  • Each column of Table control corresponds to a Static Text control (even the invisible columns).
    WINDEV Note: Columns defined as not to be printed (option "Export and print" in the "General" tab of the column description) are not taken into account.
For a table report, the order in which the columns are displayed in the report corresponds to the order of columns in the window being edited. In WINDEV, if the user modifies the order of columns in the window, the order in which the columns are displayed in the report will not be modified dynamically.
Warning Data printed in the report is sorted according to the sort column defined for the Table control.
Report based on a Table control
A report on Table control can be created:
  • from the window editor. The created report corresponds to a table report.
  • from the report editor. The report creation wizard opens, allowing you to choose the type of report to be created (array, form, etc.).
Once the report based on the Table control is created, you can:
  • change the data source of the report ("Data" tab in the report description).
  • add or delete Static Text controls linked to the Table control associated with the report.
Warning It is not possible to test a report on a Table control directly from the report editor, as the window or page containing the Table control must be open. To run the test of a report based on a Table control, you must:
  • create (if necessary) a button in the window or in the page of Table control. This button can be used to print the report with the data from the Table control (iPrintReport).
    Internal windows: If the Table control is present in an internal window, it is advisable to create the button in the internal window and not in the host window.
  • test directly the window or page containing the Table control, then test the report (via the button).
    Case of internal windows: the test must be run from the window that hosts the internal window.
Creating a report based on a Table control from the window editor
WINDEV The window editor allows you to automatically create a report based on a Table control and a button used to print the report. No programming required.
Note The window editor can only be used to create an array report. To create another type of report, use the report editor.
WINDEV

Creating a report automatically and a button used to print the report

To automatically create a report and a button used to print the report:
  1. Open the window containing the Table control on which the report will be based.
  2. Select the Table control.
  3. On the "" tab, in the "" group, expand "" and select "Report based on a Table control".
  4. The mouse cursor changes and the button shape appears under the cursor. Click in your window to create and position the button. This button is used print the report based on the Table control.
  5. A table report based on the selected Table control is automatically created in the report editor. For more details, see .
  6. Confirm that the created report must be added into the current project.
  7. Save the created report and the window containing the Table control.
WINDEV

Characteristics of the new report based on a Table control

By default:
  • the created report is a Table report. For more details, see The different types of reports.
  • the created report is named "Report_<CaptionTableControl>".
  • the created report contains:
    • a table containing as many columns as the Table control.
      By default, the width of columns in this table corresponds to the width of columns in the Table control.
      If the table does not occupy the entire report width, the table columns are proportionally enlarged in order for the table to reach its maximum size.
      Please note Columns defined as not to be printed (option "Export and print" in the "General" tab of the column description) are not proposed.
    • a Static Text control displaying the caption of Table control.
    • four preset controls used to display today's date, the number of the current page, the total number of pages in the report and the total number of lines printed in the report.
  • the skin template of created report corresponds to the skin template of current project.
  • the report prints all rows found in the Table control.
All these characteristics can be modified in the report editor.
Creating a report based on a Table control from the report editor
The report editor lets you create any type of report based on a Table control (array, form, etc.).
Once the report is created, the print must be programmed in WLanguage. For more details, see Printing a report based on a Table control.

Creating a report based on a Table control from the report editor

To create a report based on the Table control from the report editor:
  1. Click New in the quick access buttons.
    • The new element window appears. Click "Report", and then "Report".
    • The report creation wizard opens.
  2. Choose your report layout (array, card, label, etc.). For more details, see The different types of reports.
  3. Select (if necessary) the report template to use. A report template allows you to use a specific layout. For more details on report templates, see Report templates.
  4. Select the data source of the report ("From a Table or Looper control").
  5. Select the Table control on which the report will be based. Only the Table and Looper controls in the windows or pages of the current project will appear.
  6. WINDEV To print:
    • all rows displayed in the Table control: select the "All Table control rows" option.
    • only user-selected rows: select the "Only rows selected in the Table control" option.
      Note This choice can be modified by programming using the SelectionOnly property.
  7. For each Table control column displayed in the report:
    • specify whether the column must be printed or not via the checkmark.
    • type the corresponding caption. This caption will be displayed:
      • before the control. For example:
        Caption before the control
      • in the column header (for the Table reports). For example:
        Caption in the columns

        You can also change the caption directly in the report editor.
    • select the block in which the control associated with the column of Table control will be printed. The positions of different controls can be modified in the report editor. For more details on the different blocks and their position in a report, see Report blocks.
  8. Modify (if necessary) the display order of controls in the report with the arrow buttons found on the right of table.
  9. If the Table control associated with the report contains at least one numeric item, calculations can be performed on these items. Specify the calculation performed for each item (sum, average, ...). Two types of calculations are available:
    • general calculation: a Calculated field will be created in the block End of document.
    • calculation on breakage: a Calculated field will be created in the Breakage bottom block. In the calculations on break, the calculation result is reinitialized after each break. To perform this type of calculation, the report must contain at least one break.
  10. Depending on the type of report being created, indicate the specific options.
    Type of reportSpecific options
    Report based on a formForm image, form image print mode, etc.
    Options presented in detail in Report based on a form
    Label reportLabel format, number of identical copies, etc.
    Options presented in detail in Label report
  11. Specify the format of the sheet on which the report will be printed. By default, the report is printed in A4 format.
    Note: By default, the report controls are displayed in a single column. To create a multi-column report, simply specify the desired number of columns in the "Format" tab of the report description window.
  12. Select the skin template of the report if necessary.
  13. Type the name and title of the report (name of the ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
    WINDEV You can also specify whether the report can be modified by the end user in "Reports & Queries".
  14. Confirm the report creation.
  15. The report editor automatically suggests changing the report format in the following cases:
    • the report includes a table.
    • the report format does not allow to display all table columns.
  16. If necessary, specify the mode for reducing the size of the report:
    • Print the report on several pages. In this case, the end user will have to group the pages. For more details, see Print on multiple pages.
    • Use the landscape mode.
    • Reduce the report size. Note: Depending on the reduction percentage selected, the printed report may become illegible.
  17. The report is displayed in the report editor.
Printing a report based on a Table control

Printing a report based on a Table control

A report based on a Table control must be printed from the window displaying the Table control to print. If the button was not created automatically, you must:
  1. Create a button in the window (or page) containing the Table control.
  2. Configure the report print destination:
    • WINDEV In WINDEV, using iDestination (report viewer, print to an HTML file, etc.).
    • WEBDEV - Server code In WEBDEV, using iDestination (print to an HTML file, etc.).
    For more details, see Print modes of a report.
  3. Specify the name of the report to print with iPrintReport.
Remarks:
  • If additional parameters must be passed to the report, these parameters must be specified in iPrintReport, after the name of the report to print. For more details, see Report with parameters.
  • WINDEV If the window that contains the source Table control is opened multiple times (modeless opening with OpenChild), the full name of the control to be printed must be passed as a parameter to the report. For example:
    // La propriété NomComplet va contenir le nom de la fenêtre 
    // qui doit être ouverte avec un alias 
    // afin de distinguer chaque fenêtre
    iPrintReport(ETAT_Table_Client, TABLE_Client.NomComplet)

    // Code d'ouverture de l'état : 
    PROCEDURE ETAT_Table_Client(NomTableSource)
    MyReport.NomSource = NomTableSource
  • WINDEV The SelectionOnly property is used to identify and modify the records to be printed in the report: print all records or only selected records.
In Reports & Queries, you can print a report:
  • by starting a print job (Print icon).
  • by testing the report (Report Go).
Therefore, no programming is required to print the report.
WINDEV

WINDEV example

The information to print is in the Table control named "TABLE_CustomerTable" found in the "WIN_Customer" window.
The report to print is named "RPT_Customer" and it is printed during a click on the "BTN_Print" button.
In this example, the click code of "BTN_Print" button is as follows:
// Ouvrir le visualisateur de rapports
iDestination(iViewer)
// Imprimer l'état basé sur le champ Table "TABLE_TableClient" 
iPrintReport(ETAT_Client)
WEBDEV - Server code

WEBDEV example

The information to print is in the Table control named "TABLE_CustomerTable" found in the "PAGE_Customer" page.
The report to print is named "RPT_Customer" and it is displayed in a PDF file during a click on the "BTN_Print" button.
In this example, the click code of "BTN_Print" button is as follows:
// Génère un nom de fichier unique 
NomFicUnique is string = fWebDir() + "\" + "ETAT_Client_" + DateSys() + TimeSys() + ".pdf" 
// Paramètre la destination de l'impression
iDestination(iPDF, NomFicUnique) 
// Imprime l'état basé sur le champ Table TABLE_TableClient
iPrintReport(ETAT_Client) 
// Affiche l'état au format PDF
FileDisplay(NomFicUnique, "application/pdf")
// Supprime le fichier
fDelete(NomFicUnique)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/08/2025

Send a report | Local help