PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV 28 feature!
  • In this lesson you will learn the following concepts
  • Overview
  • Printing the content of a Table control
  • Printing directly via the AAFs (Automatic Application Features)
  • Creating an automatic report based 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:
  • through programming.
  • via reports. A report is a graphic representation of a document. 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 based on form,
  • Multicolumn report,
  • Composite report.
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".

Answers

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.

Printing directly via the AAFs (Automatic Application Features)

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 28.PDF. This file is automatically included in your application if you choose the "AAF help" 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 "Find orders" tab 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, open the context menu of the control (click the Control context menu icon at the top right or right-click the control).
    7. Click "Print".
    8. Choose to print the content of the 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 based on the Table control. If the report exists, it will be automatically used by the option for printing the Table control.

Creating an automatic report based on a Table control

If you want to create a report to print the data from a Table control, simply create a "Report based on a Table control": the report corresponding to the Table control is automatically created.

  • To create a "Report based on a Table control":
    1. Open the "Find orders" tab pane in the window editor.
    2. On the "Creation" tab, in the "Data" group, expand "Table and List Box" and select "Report based on a Table control".
    3. Since this window contains 2 Table controls on different tab panes, WINDEV prompts you to select the desired 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 where you want to create the control in the window (e.g., below the "Find" button, in the "Find orders" tab pane).
    6. The report is automatically created.
    7. A window to save the report appears. 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 from the window. We will make changes to this report: we will change the title.
      • Select the control that corresponds to the report title ("QRY_FindOrders Table") and double-click on it.
      • In the description window, modify the caption and enter "Sought orders".
      • Validate.
    10. Go back to the "WIN_Menu" window (click "WIN_Menu" in open document tabs).
    11. If necessary, change the size and position of the "Print" button (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 "Find orders" tab 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 28
Comments
Click [Add] to post a comment