PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV 25 feature!
  • This lesson will teach you the following concepts
  • Overview
  • Printing the content of a Table control
  • Direct print via the AAF (Automatic Application Feature)
  • Creating an automatic report on Table control
Lesson 4.5. Printing the content of a Table control
This lesson will teach you the following concepts
  • Printing the content of a Table control.
  • Printing an order form.
Lesson duration

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
Overview
WINDEV allows you to print your data:
  • by programming.
  • via the reports. A report is the name given to the graphic representation of a print. A report is created via the report editor.
WINDEV proposes several types of reports:
Report creation wizard
  • Blank,
  • Form,
  • Table,
  • Crosstab,
  • TreeView table,
  • Gantt Chart,
  • Organizer or scheduler,
  • Spreadsheet,
  • Mailing,
  • Label,
  • Report on form,
  • Multicolumn report,
  • Composite.
We are now going to explain how to create the different types of reports in the "WD Full Application" application.

Answer

If you did not create the windows in the previous lessons, you can follow this lesson by opening a corrected project: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (With windows)".
A full corrected application project is also available: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)". In this case, to follow the rest of the lesson, select the "Windows 32-bit executable" configuration in the "Project explorer" pane.
Printing the content of a Table control
In the previous lesson, we have created a Table control used to display the result of a multi-criteria search. Let's take a look at the different methods used to print the content of this Table control.

Direct print via the AAF (Automatic Application Feature)

In the previous lessons, you have noticed that several automatic features (called AAF) were proposed by WINDEV. An AAF allows you to print the content of a Table control.

Remark

A list of the most common AAFs (Automatic Application Features) can be found in WINDEV AAF 25.PDF. This file is automatically included in your application if you choose the "Help for AAF" option when creating the automatic menu.
  • Let's run a quick test:
    1. Display "WIN_Menu" in the window editor (if necessary).
    2. Click Run the test of a window among the quick access buttons.
    3. Select the "Finding orders" tab pane if necessary.
    4. Define the different search parameters:
      • Status of orders,
      • Payment method,
      • Range of dates to take into account.
    5. Click "Find".
    6. When the data is displayed in the Table control, display the popup menu of control ( Popup menu of control icon at the top right or right click on control).
    7. Click "Print".
    8. Choose (if necessary) to print the content of Table control in "Landscape" mode. The report corresponding to the control is displayed in the report viewer.
      Report displayed in the report viewer

      Remark

      In test mode, the content of the Table control is printed directly.
      At runtime, the end user will be able to print directly, or to start "Reports & Queries" to create the corresponding report. For more details about Reports & Queries, see "Distributing "Reports & Queries" with your applications".
    9. Close the report viewer and stop the application test.
You want to customize the report proposed by default? All you have to do is create an automatic report on Table control. This report (if it exists) will be automatically used by the option for printing the Table control.

Creating an automatic report on Table control

To create a report used to print the data found in a Table control, all you have to do is create a "Report on Table control": the report corresponding to the Table control is automatically created.

  • To create a "Report on Table control":
    1. If necessary, display the "Finding orders" tab pane (click it) in the window editor.
    2. On the "Creation" pane, in the "Data" group, expand "Table and List Box" and select "Report on Table control".
    3. Our window containing 2 Table controls on different tab panes, WINDEV asks you to select the requested Table control. In our case, select "TABLE_QRY_FindOrders" and validate.
    4. The shape of a Button control appears under the mouse cursor. This control is automatically created and it contains the WLanguage code used to print the content of the Table control.
    5. Click the position where the control will be created in the window (below the "Find" Button control for example in the "Finding orders" tab pane).
    6. The report is automatically created.
    7. A window is displayed, allowing you to save the report. Validate.
    8. The report editor appears with the report that was automatically created.
      Report automatically created in the report editor
    9. In this report, you will find the titles of the Table control columns in the window. We are going to perform a modification in this report: we want to modify the title.
      • Select the control corresponding to the report title ("QRY_FindOrders Table" is displayed in the control) and double-click this control.
      • In the description window, modify the caption and enter "Sought orders".
      • Validate.
    10. Go back to the "WIN_Menu" window (click the "WIN_Menu" button in the bar of open elements).
    11. Modify (if necessary) the size and position of the "Print" Button control (to match the size of the "Find" Button control).
    12. Save the window by clicking Save an element among the quick access buttons.
    13. Run the window test: click Run the test of a window among the quick access buttons.
      • Select the "Finding orders" tab pane if necessary.
      • Define the different search parameters:
        • Status of orders,
        • Payment method,
        • Range of dates to take into account.
      • Click "Find".
    14. When the data is displayed in the Table control, click the the "Print" button or select "Print" from the popup menu of the Table control: the report that was just created is used in both cases.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 25
Comments
Click [Add] to post a comment