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
  • Printing the content of a Table control
  • Direct print via the AAF (Automatic Application Feature)
  • Creating an automatic report on a Table control
Lesson 4.4. Printing the content of a Table control
In this lesson you will learn 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 reports. A report is a graphic representation of a printout. Reports are created in the report editor.
WINDEV offers 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 will now explain how to create the different types of reports in "WD Full Application".
  • 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".

Answer

A corrected project is available. This project contains the different reports created in this lesson. 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)".
Printing the content of a Table control
In the previous lesson, we created a Table control 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 previous lessons, we discovered that WINDEV includes several automatic features (called AAF). One AAF allows you to print the content of a Table control.

Note

A list of the most common AAFs (Automatic Application Features) can be found in WINDEV AAF 26.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. Open "WIN_Menu" in the window editor.
    2. Click Test window in the quick access buttons.
    3. Select the "Finding orders" tab pane if necessary.
    4. Define the different search parameters:
      • Order status,
      • 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 ( Control context menu 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

      Note

      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 default report? Simply create an automatic report on the Table control. This report (if it exists) will be automatically used by the option for printing the Table control.

Creating an automatic report on a Table control

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

  • To create a "Report on Table control":
    1. Open the "Finding orders" tab pane in the window editor.
    2. On the "Creation" tab, 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 in the quick access buttons.
    13. Test the window: click Test window in the quick access buttons.
      • Select the "Finding orders" tab pane if necessary.
      • Define the different search parameters:
        • Order status,
        • Payment method,
        • Range of dates to take into account.
      • Click "Find".
    14. When the data is displayed in the Table control, click "Print" or select "Print" in the context 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 26
Comments
Click [Add] to post a comment