ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV 2024 feature!
Help / WINDEV Tutorial / Tutorial - Reports and Queries
  • Distribute Reports and Queries with your applications
  • Overview of Reports and Queries
  • How to distribute Reports and Queries with your application
  • Step 1: Configuring the project
  • Step 2: Defining hidden data files and items in Reports and Queries
  • Step 3: Defining the reports and the queries that can be edited in Reports and Queries
  • Step 4: Creating the executable and distributing the application
  • Installing and using Reports and Queries
  • Installing the application
  • Application test
  • Conclusion

Tutorial - Reports and Queries

Distribute Reports and Queries with your applications
We will cover the following topics:
  • What is Reports and Queries used for?
  • How to distribute Reports and Queries.
  • How to use Reports and Queries.
Durée de la leçon 10 min
Overview of Reports and Queries
Reports and Queries allows users to edit and create reports and queries in WINDEV applications.
For example, if a user considers something is missing in the report that comes with their application, they can use Reports and Queries to add the data they need directly from the report viewer. The report can be made available to all users using the application over a network. The same principle applies to the queries.
Reports and Queries is free and can be distributed with the applications developed with WINDEV. For more details on distribution and use conditions, see the license.
Reports and Queries can be launched by simply opening a report in the report viewer. If the application has been configured to use Reports and Queries, users can then click the icon.
How to distribute Reports and Queries with your application
To distribute Reports and Queries with your WINDEV application, make the following changes in your project:
  • Step 1: specify in the project that the application allows Reports and Queries to be run.
  • Step 2: in the analysis, define (if necessary) the files and items that can be used in Reports and Queries.
  • Step 3: choose the reports and queries than can be edited in Reports and Queries.
  • Step 4: create the executable and the setup program including Reports and Queries.
We are going to present these different steps in details by using the "WD Full Application" project.
Opening the example project
  1. Go to the WINDEV home page (Ctrl + <).
  2. On the home page, click "Tutorial", then in "Tutorial - WINDEV Application: Manage data", double-click "Full application - Answers".

Step 1: Configuring the project

To use Reports and Queries from your application, you must configure the project associated with your application.
  1. Open the "WD Full Application" project description.
    Reminder: To open the project description, go to the "Project" tab, "Project" group and click "Description".
  2. In the "Advanced" tab, check "Enable Reports and Queries".
  3. Validate.

Step 2: Defining hidden data files and items in Reports and Queries

By default, all data files and items can be viewed and used in Reports and Queries. If your application contains sensitive information (passwords, etc.), you can make these data files or items invisible in Reports and Queries.
Reports and Queries does not allow users to add, modify or delete records. It also prevents users from creating or recreating data files.
We will open the analysis to configure the data files and items that can be used in Reports and Queries.
Open the analysis of your project: click Load project analysis in the quick access buttons of the WINDEV menu.
We will configure the "PaymentMethod" file so that it becomes invisible in Reports and Queries:
  1. Select the "PaymentMethod" data file in the data model editor.
  2. Open the data file description window (select "Data file description" in the context menu).
  3. In the "Reports and Queries" tab, uncheck the "Visible to the end user in Reports and Queries" option.
  4. Validate.
Now, we will make the "Visual" item of the "Product" data file invisible:
  1. Select the "Product" data file in the data model editor.
  2. Open the description window of the data file items (select "Description of items" in the context menu).
  3. In the list of items, select "Visual".
  4. In the "Reports and Queries" tab, uncheck "Visible to the end user in Reports and Queries".
  5. Validate.
Let's regenerate the analysis to apply changes:
  1. On the "Analysis" tab, in the "Analysis" group, click "Generation". An automatic data file modification is proposed to take the modifications into account.
  2. Keep the default options in the different steps of the automatic data modification, and confirm changes.
  3. Close the data model editor.

Step 3: Defining the reports and the queries that can be edited in Reports and Queries

By default, any report or query can be edited in Reports and Queries.
Reports allow UI editing only. The steps to create a report are described in lesson 4 of the "Full application with data" tutorial.
To make "RPT_List_of_customers" editable in Reports and Queries:
  1. Open "RPT_List_of_customers" in the report editor.
  2. Open the report description (select "Report description" in the context menu).
  3. In the "Options" tab, check "Allow editing report in Reports and Queries".
  4. Next, check one of the following options:
    • "Edit interface only" to allow editing only the report interface in Reports and Queries.
    • "Edit all (interface and code)" to make the report fully editable in Reports and Queries.
  5. Validate and save the report.
By default, a query can be modified in Reports and Queries.
To allow the "QRY_OrderForm" query (found in the "WD Full Application" project) to be modified in Reports and Queries:
  1. Open the "QRY_OrderForm" query in the query editor.
  2. Open the query description (select "Query description" in the context menu of the query graph).
  3. Click the "Advanced" button (in the "Actions").
  4. In the "Reports and Queries" tab, check "Visible in Reports et Queries".
  5. Validate and save the query.

Step 4: Creating the executable and distributing the application

An application that uses Reports and Queries can be distributed as any other application. You can specify the parameters specific to Reports and Queries when creating the setup procedure.

To create the setup program of WD Full Application:
  1. On the "Project" tab, in the "Generation" group, click "Setup procedure". The setup creation wizard starts. Click the "Setup" link on the left of wizard.
  2. Select "Create the executable now". The executable file is created.
    Remark: If the wizard proposes to create the help file, validate the different messages.
  3. The setup creation wizard starts.
    The steps to creating the executable and the setup program of an application are described in Deploying the application.
  4. Choose an "Individual setup". Go to the next step.
  5. Choose a "Standard setup". Go to the next step.
  6. Validate the default installation directory and go to the next step.
  7. In the screen named "Files installed", select (if necessary) the data files (.fic, .mmo and .ndx) in the executable directory. To do so, click "Add" and select these files.
  8. Click on "Additional information" on the left.
  9. In the screen "Additional modules" screen, make sure that "Include the setup of Reports and Queries (caution: large)" is checked.
  10. Go to the next step.
  11. In the step entitled "Reports and Queries":
    • Specify whether the setup of Reports and Queries must be included in your setup program.
      In this case, the Reports and Queries installation package will be used. This package is located in the "Install\Reports And Queries" subdirectory of the WINDEV installation directory.
      You can:
      • Propose to install Reports and Queries with the application.
      • Propose to install Reports and Queries when it is first used.
      Caution: Including Reports and Queries significantly increases the size of your setup program (2 GB, approximately).
    • Specify (if necessary) the directories corresponding to the reports and queries modified or created by the end user:
      • The directory of personal reports and queries is the directory that contains the reports and queries visible only to the user who created them.
      • The directory of shared reports and queries is the directory that contains the reports and queries visible to all users of the application.
      These directories can be modified when installing the application: simply check "Allow these directories to be modified during the setup".
  12. Click "Medium" on the left of the wizard. This step allows you to select the setup media, the directory for creating the setup program if necessary, and also to protect the setup with a password.
  13. Keep the default options and finish the wizard. The setup program is generated. Don't close the last setup creation window.
Installing and using Reports and Queries

Installing the application

To test the setup and Reports and Queries, we will install the "WD Full Application" application.
We have just generated the setup program for this application. The setup program was created in the "Install" subdirectory of the current project.
In the last setup creation window, click "Install". If you closed this window, run the "Install.exe" program located in the setup program directory. The application setup starts.
We will go through the different steps of the "WD Full Application" setup program.
  1. If UAC is enabled, a window appears and requests authorization to run the program. Validate this window.
  2. The setup wizard starts.
    You can change the setup language via a combo box at the upper-right corner of the wizard.
    Setup wizard

    Two setup modes are available:
    • Quick setup: The setup is performed with the parameters specified by the application provider.
    • Custom setup: The wizard asks the user to define the parameters of the application setup.
  3. Choose "Custom setup". The wizard asks for the application installation directory.
  4. If necessary, select the application installation directory and go to the next step.
  5. The "Reports and Queries" step allows you to install Reports and Queries.
    Select "Install 'Reports and Queries'" and specify the installation directory.
    Remark: If an earlier version of Reports and Queries is installed on the computer, it is possible to make a backup copy of that version.
  6. Go to the next step.
  7. The next step allows you to define the directories where the reports and queries will be saved (if the option "Allow these directories to be modified during the setup" was checked in the setup program creation wizard).
  8. Go to the next step and finish the application setup.
  9. The application setup, then the setup of Reports and Queries start.
  10. The last step of the wizard allows you to immediately launch the application and create the application icons.

Application test

We will test the application from the user's perspective.
To test the application:
  1. Start the "WD Full Application" application.
  2. Select "Reports .. List of customers". The report is displayed in the report viewer. Click the "Preview" pane.
  3. Two new icons are displayed on this screen:
    Allows you to edit the current report in the report viewer.
    Allows you to create a new report.
We are going to modify this report:
  1. Click .
  2. The report is displayed in edit mode in Reports and Queries.
  3. Users can make their own changes:
    • on the style of the displayed information (change the color of a control for example).
    • on the content of the report (add a control for example, etc.). If the report is linked to a query, the user can modify this query.
      • If the report is linked to an embedded query, the modification is directly performed in the report.
      • If the report is linked to an independent query, the query is also modified. Changes will be taken into account when running the report (if a window also uses this query, it won't take the changes into account).
In this example, we want to highlight the date in red. To do so:
  1. Select the date control in the start of document.
  2. On the "Modification" tab, in the "Quick edit" group, click the "Color" icon. In the window that appears, select the color red and validate.
  3. Save your report. The default directory corresponds to the application installation directory.
  4. Close Reports and Queries.
  5. Select "Reports .. List of customers" in the application. The report is displayed in "Report viewer" and the modification is applied.
In this example, the modified report is available to you only. For a network application, the user has the ability to make a modified report available to all the users.
You are now familiar with Reports and Queries.
For more details, see The user report editor (Reports and Queries).
Conclusion
In this tutorial, we learned how to prepare an application to use Reports and Queries. We also installed this application and edited a report using the report viewer.
There are other methods to use Reports and Queries from your application. You can:
  • add the '?' automatic help menu in the main window of the application. This menu must contain the following options: "Create or edit a report" and "Create or edit a query". For more details, see "?" menu.
  • use RunReportsAndQueries in the application.
In both cases, if Reports and Queries is not installed on the user's computer, an installation window will open.
Table of contents
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 12/14/2023

Send a report | Local help