PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV 24 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.

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:
  • Blank,
  • Form,
  • Table,
  • Crosstab,
  • TreeView table,
  • Gantt chart.
  • Organizer or schedule,
  • 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 the WINDEV home page (Ctrl + <), click "Tutorial" and select "Full application (With windows)".
A full corrected application project is also available: in the WINDEV 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.
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.

Note

The entire list of AAFs (Automatic Application Features) is available in the WINDEV AAF 24.PDF file. 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 (if necessary) the "WIN_Menu" window in the window editor.
    2. Click on among the quick access buttons.
    3. Select the "Finding orders" tab if necessary.
    4. Define the different search parameters:
      • Status of orders,
      • Payment mode,
      • Range of dates taken into account.
    5. Click the "Find" button.
    6. When the data is displayed in the Table control, display the 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 a preview window.

      Note

      In test mode, the content of the Table control is printed directly.
      At run time, the end user will be able to print directly or to start "Reports and Queries" in order to create the corresponding report. See "Distributing "Reports & Queries" with your applications" for more details about Reports and Queries.
    9. Close the preview window 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 is automatically created.

  • To create a "Report on Table control":
    1. If necessary, in the window editor, display the "Finding orders" tab (click it).
    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 appears under the mouse cursor. This button is automatically created and it contains the code used to print the content of the Table control. Click the position where the button will be created in the window (below the "Find" button for example in the "Finding orders" tab).
    5. The report is automatically created.
    6. A window is displayed, allowing you to save the report. Validate.
    7. The report editor appears with the report that was automatically created.
    8. This report includes the titles of columns found in the Table control. 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.
    9. Go back to the "WIN_Menu" window (click the "WIN_Menu" button found in the bar of opened elements for example).
    10. Modify (if necessary) the size and position of the "Print" button (in order for its size to be identical to the one of the "Find" button).
    11. Save the window by clicking among the quick access buttons.
    12. Run the window test: click among the quick access buttons.
      • Select the "Finding orders" tab if necessary.
      • Define the different search parameters:
        • Status of orders,
        • Payment mode,
        • Range of dates taken into account.
      • Click the "Find" button.
    13. When the data is displayed in the Table control, click the print button or select "Print" from the popup menu of Table control: the report that was just created is used in both cases.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment