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
  • Creating a report based on a TreeView Table control from the report editor
  • Creating a report based on a TreeView Table control from the report editor
  • Characteristics of the report based on a TreeView Table control
  • Report test
  • Printing a report based on a TreeView Table control
  • Printing a report based on a TreeView 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 TreeView Table control
Overview
You can use a report based on a TreeView Table control to directly print the information displayed in a TreeView Table control found:
  • in a window or page of the application. This window or page must be displayed when printing the report.
  • in an internal window or an internal page:
    • The window displaying the internal window must be displayed.
    • The page displaying the internal page must be displayed.
A report based on a TreeView Table control can print:
  • all the rows displayed in the TreeView Table control.
  • the rows selected by the user (for the multi-selection TreeView Table controls where the rows are selected with the Ctrl key). This option is not available in WEBDEV.
  • the entire hierarchy.
  • the hierarchy visible in the TreeView Table control.
Remark: Only an array report can be created on a TreeView Table control..
Creating a report based on a TreeView Table control from the report editor
The report editor allows you to create a TreeView Table report based on a TreeView Table control. Each row and each column found in the TreeView Table control are displayed in the TreeView Table report.
Once the report is created, the print must be programmed in WLanguage. For more details, see Printing a report based on a TreeView Table control.
Reports & Queries does not allow you to create reports based on a TreeView Table control. However, it is possible to customize reports on a TreeView Table control created in the built-in report editor (color, font, size, etc.).

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

To create a report based on a TreeView Table control from the report editor:
  1. 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. Choose a "TreeView Table" report.
  3. Select "From a TreeView Table control" and go to the next step.
  4. Specify:
    • the TreeView Table control on which the report will be based. Only the TreeView Table controls in the windows or pages of the current project are proposed.
    • whether only the selected rows must be printed or whether all the control rows must be printed.
  5. Select the items (columns of TreeView Table control) to print and their position (associated block).
  6. Specify whether calculations must be performed on the numeric items.
  7. Specify the format of sheet on which the report will be printed. The report is printed in A4 format by default.
  8. Select the skin template to use.
  9. Type the name and title of the report (name of ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
    WINDEV You also have the ability to specify whether the report can be modified by the end user in Reports and Queries.
  10. Validate the report creation.
  11. The report editor automatically proposes to change the format of the report.
  12. Specify the mode for reducing the report size:
    • Print the report on several pages. In this case, the end user will have to group the pages. For more details, see Multi-page print.
    • Use the landscape mode.
    • Reduce the report size. Please note: depending on the reduction percentage selected, the printed report may become illegible..
  13. The report currently created is displayed in the report editor.
Characteristics of the report based on a TreeView Table control
A report based on a TreeView Table control is similar to a report based on a Table control, but with additional characteristics.
The report includes a table. For more details, see:
In the report description, information specific to this type of report can be configured in the "Data" tab:
  • WINDEV Printed lines: As with the Table field, you can specify whether only selected lines or all lines in the field are to be printed.
  • Print hierarchy: You can specify whether only the hierarchy displayed in the field is to be printed or the entire hierarchy..

Report test

You cannot test a report based on a TreeView Table control from the report editor because the window or the page containing the TreeView Table control must be open. To test a report based on a Treeview Table control:
  • create (if necessary) a button in the window or in the page of TreeView Table control. This button can be used to print the report with the data from the TreeView Table control iPrintReport).
    Internal windows or pages: If the TreeView Table control is present in an internal window or page, it is advisable to create the button in the internal window/page and not in the host window/page.
  • run the test of the window containing the TreeView Table control then run the report test (via the button).
    Case of internal windows: the test must be run from the window that hosts the internal window.
  • run the test of the page containing the TreeView Table control then run the test of the report (via the button).
    For internal pages: the test must be run from the page hosting the internal page.
Printing a report based on a TreeView Table control

Printing a report based on a TreeView Table control

A report based on a TreeView Table control must be printed from the window (or from the page) displaying the TreeView Table control to print. To do so:
  1. Create a button in the window (or in the page) containing the TreeView Table control.
  2. Configure the report print destination: 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 TreeView 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:
    // 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_TableH_Client, TABLEH_TableClient.NomComplet)
    // Code d'ouverture de l'état: 
    PROCEDURE ETAT_TableH_Client(NomTableHSource)
    MyReport.NomSource = NomTableHSource
  • 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.
  • The KeepVisibleHierarchy property is used to identify and modify the hierarchy print mode: printing of the complete hierarchy or printing of the hierarchy visible in the field.
In Reports & Queries software, you can print a report:
  • by starting a print job ().
  • by testing the report ().
Therefore, no programming is required to print the report.
WINDEV

WINDEV example

The information to print is in the Treeview Table control named "TVT_CustomerTable" found in the "WIN_Customer" window.
The report to print is named "RPT_TreeViewTable_Customer" and it is printed when the "BTN_Print" button is clicked.
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 hiérarchique "TABLEH_TableClient" 
iPrintReport(ETAT_TableH_Client)
WEBDEV - Server code

WEBDEV example

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

Last update: 09/21/2024

Send a report | Local help