- Operating mode
- Printing the report created by the developer
- Directly print the content of the Table control
- Printing from "Reports and Queries"
Printing the content of a table (AAF)
A Table control proposes an automatic popup menu allowing the user to perform several operations on the data displayed in the control.
One of the options in this context menu allows the user to print the contents of the Table control ("Print" option).
Several cases may occur:
- If the developer has created a report on this Table control, the report is printed.
- If no report is linked to this Table control, the user can:
- directly print the content of a Table control.
- start "Reports & Queries" (if it is installed on the user computer).
Differences between runtime and test mode: In test mode, "Print" proposes to print directly or to create a report on table. This report will automatically be linked to Table control and will be proposed by default to the user.
- The "Print" option in the Table control popup menu requires the print libraries of the WINDEV framework.
- In the code, AAFDisable with the aafPrintReportOnTable constant, removes the "Print" option for the specified Table control.
Printing the report created by the developer
If the developer has created a report on the Table control, the "Print" option will directly print the report. No specific programming is required.
Directly print the content of the Table control
The content of a Table control can be directly printed in the following cases:
- the developer has not created a report for the Table control.
- "Reports and Queries" is not installed on the user computer,
- the application cannot be used to start "Reports and Queries".
The content of the Table control is directly displayed in the report viewer.
If the Table control has too many rows (more than 10,000), it asks the user for confirmation (printing can be relatively long and consume memory resources).
If necessary, the application:
- proposes to print in landscape mode,
- informs that all the columns will not be printed on the same page. In this last case, the user has the ability to resize the columns. If no resizing is performed, the content of the Table control will be printed on several pages if necessary.
The print characteristics are as follows:
- The print title corresponds to the title of the Table control. If no title was specified for the control, the text "Report on table (AAF)" is printed.
- The column titles are printed on each page.
- The print respects the background colors used for the different cells found in the Table control.
- The print job does not reflect the RTF attributes of the text in the Table control.
- The counters, the totals, ... defined for the Table control are not printed. Only a row counter can be printed below the Table control. The caption corresponds to the caption defined for the counter in the window editor.
- Today's date is printed in the upper-right corner.
- The number of the current page and the total number of pages are printed in the lower-right corner.
- The horizontal merge of columns is kept, except in the following cases:
- merge with an invisible column
- merge of columns that "overlay" over 2 pages.
- Images in Table controls are printed only if their path is specified. Images in memos are not printed.
- The printing follows the writing direction specified by TextDirection for the window and/or for the Table control.
- Columns defined as non exportable and non printable will not be printed (VisibleInExportAndPrint property or "Export and print" option in the "General" tab of the column description window).
Printing from "Reports and Queries"
"Reports and Queries" is automatically started. The report is automatically created in "Reports and Queries". The user can format it according to his own requirements. All you have to do is save the report in order for this one to be linked to the table and to be printed.
If the developer creates a specific report for the Table control in a forthcoming version, the report created by the user will be used at runtime.
If "Reports & Queries" is not installed on the user computer, it can be installed automatically by the user.
Characteristics of the created report:
- The created report is a "Report based on Table" report.
- If the report is automatically created in "Reports & Queries", the merge of columns is ignored.