PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV 26 feature!
  • In this lesson you will learn the following concepts
  • Overview of "Reports and Queries"
  • Starting "Reports and Queries"
  • Distribute "Reports and Queries" with your applications
  • Configuring the project
  • Configuring the analysis
  • Configuring reports
  • Configuring queries
  • Creating the executable and distributing the application
  • Installing and using "Reports and Queries"
  • Installing the application
  • Application test
  • Conclusion
Lesson 4.14. Distribute "Reports and Queries" with your applications
In this lesson you will learn the following concepts
  • What is "Reports and Queries" used for?
  • How to distribute "Reports and Queries".
  • How to use "Reports and Queries"..
Lesson duration

Estimated time: 10 mn

Express

"Reports & Queries" is not available in the Express version.


Previous LessonTable of contentsNext Lesson
Overview of "Reports and Queries"
"Reports and Queries" allows users to modify and create the reports and queries in your applications.
Some information is missing in the standard report? "Reports and Queries" allows users to add information from the report viewer . This modification may be useful for other users? The report can be made available to all users who use the application in the network. The same principle applies to the queries.

Note

"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.
Starting "Reports and Queries"
To let users customize the reports of your application or create their own reports and queries, simply start "Reports and Queries".
To allow end users to start "Reports and Queries":
  • display your reports in the report viewer. End users will be able to start "Reports and Queries" by clicking .
  • add the automatic help menu ‘?' to the main window of your application: on the "Window" pane, in the "Bars and menus" group, expand "Main menu" and select "Add the '?' menu".
    In the wizard for creating this menu, check "Create, modify a report" and "Create, modify a query".
  • use RunReportsAndQueries in your application.
Distribute "Reports and Queries" with your applications
To distribute "Reports and Queries" with your own WINDEV application, you must:
  • specify in the project that the application allows "Reports and Queries" to be run.
  • in the analysis, define (if necessary) the files and items that can be used in "Reports and Queries".
  • define the reports and queries that can be modified in "Reports and Queries".
  • 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.
  • Open the project you worked on in the previous lesson.
    1. Go to the WINDEV home page (Ctrl + <).
    2. On the home page, click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Exercise)".
    3. A dialogue box prompts you to open the project you worked on in the previous lesson. You can open the local copy or the original project. Select "Open the local copy".

Answers

A corrected project is available. This project allows you to perform the different operations in this lesson (if you have not followed the previous lessons). To open the corrected project, go to the home page and click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Answers)".

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" pane, "Project" group and click "Description".
    2. In the "Advanced" tab, check "Enable "Reports Queries"".
    3. Validate.

Configuring the analysis

We are going to open the analysis in order to configure the files and items that can be used in "Reports and Queries".

  • Open the analysis of your project: click in the quick access buttons of the WINDEV menu.
By default, all data files and items can be viewed and used in "Reports and Queries". If your application contains sensitive information (passwords, etc.), these data files or items can be made invisible in "Reports and Queries".

Note

"Reports and Queries" does not allow users to add, modify or delete records (HAdd, HModify and HDelete are not allowed). Likewise, it is not possible to create o recreate data files (HCreation and HCreationIfNotFound are not allowed).


  • To make a data file invisible in "Reports and Queries":
    1. In the data model editor, select the desired data file.
    2. Open the data file description window (select "Data file description" in the context menu).
    3. In the "Reports and Queries" tab, uncheck "Visible by the end user in "Reports and Queries"".
    4. Validate.
  • To make and item invisible "Reports and Queries":
    1. In the data model editor, select the desired data file.
    2. Open the file description window ("Description of items" in the context menu).
    3. Select the desired item in the table.
    4. In the "Reports and Queries" tab, uncheck "Visible by the end user in "Reports and Queries"".
    5. Validate.
  • To take into account the modifications performed in the analysis, you must regenerate the analysis (on the "Analysis" pane, in the "Analysis" group, click "Generation"). An automatic modification of data files is proposed to take the modifications into account.

Configuring reports

When creating a report, you have the ability to specify whether this report can be modified in "Reports and Queries".
  • To allow the "RPT_List_of_customers" report in the "WD Full Application" project to be modified 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 "Report modifiable in Reports and Queries".
    4. Next, check one of the following options:
      • "Modifiable interface" for the report interface to be modifiable in Reports and Queries.
      • "All modifiable (interface and code)" for the entire report to be modifiable in Reports and Queries.
    5. Validate and save the report.

Configuring queries

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 & Queries"
    5. Validate and save the query.

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 the "Reports and Queries" program when creating the setup procedure.

  • To create the setup program of your WD Full Application application:
    1. On the "Project" pane, 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 is created.

      Note

      If the wizard proposes to create the help file, validate the different messages.
    3. The setup creation wizard starts.
    4. Choose an "Individual setup". Go to the next step.
    5. Choose a "Standard setup". Go to the next step.
    6. Validate the default setup 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: huge)" 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 setup package of "Reports and Queries" (located in the subdirectory "Reports and Queries" of the WINDEV setup directory) will be used.
        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 (about 550 MB).
      • 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 corresponds to the directory of reports and queries visible by the user who created them.
        • The directory of shared reports and queries corresponds to the directory of reports and queries visible by all users of the application.
        These directories can be modified when installing the application: all you have to do is 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 validate 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.
The setup program of this application was generated in the previous paragraph. The setup program was created in the "Install" subdirectory of the current project.
  • In the last setup creation window, click "Test". 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. Choose the language of the setup program and click "OK".
    3. The setup wizard starts. 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.
    4. Choose "Custom setup". The wizard asks for the application setup directory.
    5. Validate the application setup directory.
    6. The "Reports and Queries" step allows you to install "Reports and Queries".
      Select "Yes, install "Reports and Queries" now".
      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.
    7. Go to the next step.
    8. 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).
    9. Go to the next step and finish the application setup.
    10. The application setup, then the setup of "Reports and Queries" start.

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:
      Used to modify the current report in the report viewer.
      Used 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. User 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). 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" pane, 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 setup 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
The development phase of our application has been completed. The following lessons will allow you to discover:
  • how to transform your application into a multilingual application,
  • how to include your application in the Source Code Manager (SCM).
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 26
Comments
Click [Add] to post a comment