PC SOFT

WINDEV的在线文档

  • Overview
  • Characteristics of the report on a Table control
  • Creating a report on a Table control from the window editor
  • Creating a report and a button used to print the report
  • Creating a report on a Table control only
  • Characteristics of the report on Table control
  • Creating a report on a Table control from the report editor
  • Creating a report on a Table control from the report editor
  • Printing a report on a Table control
  • Printing a report on a Table control
  • WinDev and WinDev Mobile example
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Report on a Table control

Overview
The report on a Table control is used to directly print the information displayed in a Table control (browsing table, memory table or table on source) found:
  • in a window or in a page of the application. This window or page must be displayed when printing the report.
  • in a window or in an internal page. The window (or the page) that displays the internal window (or the internal page) must be displayed.

ImportantReports & Queries cannot be used to create reports on a Table control. However, you have the ability to customize the reports based on a Table control created in the report editor (color, fonts, size, ...).

A report on a Table control can print:
  • all the rows displayed in the Table control (ability to filter the data found in the Table control with the magnifier).
  • the rows selected by the user (for the multi-selection Table controls where the rows are selected via the [Ctrl] key). This option is not available in WebDev.

Characteristics of the report on a Table control
If the report is based on a Table control:
  • Each row of the Table control corresponds to a record.
  • Each column of the Table control corresponds to an item control (even the invisible columns).
For a table report, the order in which the columns are displayed in the report corresponds to the order of columns in the window currently edited. In WinDev, if the user modifies the order of the columns in the window, the order in which the columns are displayed in the report is not modified dynamically.

Caution: The data printed in the report is sorted according to the sort column defined for the Table control.

A report on a Table control can be created:

  • from the window editor. The created report corresponds to a table report.
  • from the report editor. The wizard for report creation starts and it allows you to choose the type of report to create (table, form, ...).
Once the report on a Table control is created, you can:
  • modify the data source of the report ("Data" tab of the report description).
  • add or delete Item controls linked to the Table control associated with the report.
Caution: The test of a report on a Table control cannot be run from the report editor because the window or the page containing the Table control must be opened. To run the test of a report on a Table control, you must:
  • create (if necessary) a button in the window or in the page of the Table control. This button is used to print the report on the Table control (打印报表).
    Case of internal windows: If the Table control is found in an internal window, the button should be created in the internal window (and not in the host window).
  • run the test of the window containing the Table control then run the report test (via the button).
    Case of internal windows: the test must be run from the window that hosts the internal window.

Creating a report on a Table control from the window editor
WinDev You can:
  • automatically create a report on a Table control and a button used to print the report. No programming is required.
    Note: The window editor can only be used to create a table report. To create another type of report, use the report editor.
  • create a report on a Table control. Printing the report requires WLanguage programming.
    This option allows you to easily create a report on a Table control if the report is not printed via a button (but via a menu option for example).
WinDev The window editor allows you to automatically create a report on a Table control and a button used to print the report. No programming is required.

Note : The window editor can only be used to create a table report. To create another type of report, use the report editor.

WinDev

Creating a report and a button used to print the report

To automatically create a report and a button used to print the report:
  1. Open the window containing the Table control on which the report must be based.
  2. Select the Table control.
  3. Select "Insert .. Special .. Report on Table button" or click. A table report based on the selected Table control is automatically created in the report editor.
    See Characteristics of the created report for more details.
  4. Confirm that the created report must be added into the current project.
  5. A "Print" button is automatically created in the window containing the Table control. The click code of this button is used to print the created report. Modify (if necessary) the position of this button.
  6. Save the created report and the window containing the Table control ("File .. Save").
    See Characteristics of the created report for more details.
  1. Open the window containing the Table control on which the report must be based.
  2. Select the Table control.
  3. On the "创建" pane, in the "数据" group, expand "表格和列表" and select "Report on table".
  4. The mouse cursor changes and the shape of the button appears below the cursor. Click in your window to create and position the button. This button is used print the report based on the Table control.
  5. A table report based on the selected Table control is automatically created in the report editor. See Characteristics of the created report for more details.
  6. Confirm that the created report must be added into the current project.
  7. Save the created report and the window containing the Table control.
WinDev

Creating a report on a Table control only

To create a report on a Table control only:
  1. Open the window containing the Table control on which the report must be based.
  2. Select the Table control.
  3. Select "Control .. Create a report for the table". A table report based on the selected Table control is automatically created in the report editor. See Characteristics of the created report for more details.On the "创建" pane, in the "数据" group, expand "表格和列表" and select "Report on table":
    • A button used to print the report based on the Table control is automatically created. Position this button in your window.
    • A table report based on the selected Table control is automatically created in the report editor. See Characteristics of the created report for more details.
  4. Confirm that the created report must be added into the current project and save the report ().

WinDev

Characteristics of the report on Table control

By default:
  • the created report is a Table report. See The different types of reports for more details.
  • the created report is named "Report_<CaptionTableControl>".
  • the created report contains:
    • a table containing as many columns as the Table control.
      By default, the width of the columns in this table corresponds to the width of the columns in the Table control.
      If the table does not occupy the entire width of the report, the table columns are proportionally enlarged in order for the table to reach its maximum size.
    • a Static control displaying the caption of the Table control.
    • four preset controls used to display today's date, the number of the current page, the total number of pages in the report and the total number of lines printed in the report.
  • the skin template of the created report corresponds to the skin template of the current project.
  • the report prints all the Table control rows.
All these characteristics can be modified in the report editor.

Creating a report on a Table control from the report editor
The report editor allows you to create any type of report based a Table control (table, form, ...).

Once the report is created, the print must be programmed in WLanguage. See Printing a report on a Table control for more details.

Creating a report on a Table control from the report editor

To create a report on a Table control from the report editor:
  1. Select "File .. New .. Report". The wizard for report creation starts.Clickamong the quick access buttons.
    • Click "Report" in the wheel that is displayed.The window for creating a new element is displayed: click "Report" then "Report".
    • The wizard for report creation starts.
  2. Choose the layout of your report (table, form, label, ...). See The different types of reports for more details.
  3. Select (if necessary) the report template to use. A report template is used to comply with a specific page layout. See The report templates for more details.
  4. Select the data source of the report ("From a Table control").
  5. Select the Table control on which the report will be based. Only the Table controls found in the windows or pages of the current project are proposed.
  6. WinDev To print:
    • all the rows displayed in the Table control: select "All the rows found in the Table control".
    • the rows selected by the user: select "Only the rows selected in the Table control".
      Note : This choice can be modified by programming with ..仅选定行.
  7. For each column of the Table control displayed in the report:
    • enter the corresponding caption. This caption will be displayed:
      • before the item. For example:
      • in the header of the column (for the Table reports). For example:

        This caption can be modified in the report editor.
    • select the block in which the control associated with the column of the Table control must be printed. The positions of the different controls can be modified in the report editor. See Report blocks for more details.
  8. Modify (if necessary) the display order of the controls in the report with the arrow buttons found on the right of the table.
  9. If the Table control associated with the report contains at least one numeric item, calculations can be performed on this item. Specify the calculation performed for each item (sum, average, ...). Two types of calculations are available:
    • general calculation: a Calculated control will be created in the End of document block.
    • calculation on break: a Calculated control will be created in the Break footer block. In the calculations on break, the result of the calculation is re-initialized after each break. To perform a calculation on break, a break must be found in the report currently created.
  10. Depending on the type of report currently created, indicate the specific options.
    Type of reportSpecific options
    Type of report: Table + ChartType of the chart, aspect of the chart, ...
    Options presented in Table + Chart report
    Chart reportType of the chart, aspect of the chart, ...
    Options presented in Chart report
    Report on formImage of the form, print the image of the form, ...
    Options presented in Report on form
    Label reportFormat of labels, number of identical copies, ...
    Options presented in Label report

    Type of reportSpecific options
    Report on formImage of the form, print the image of the form, ...
    Options presented in Report on form
    Label reportFormat of labels, number of identical copies, ...
    Options presented in Label report
  11. Specify the format of the sheet on which the report will be printed. The report is printed in A4 format by default.
    Note: By default, the report controls are displayed in a single column. To create a multi-column report, the requested number of columns must be specified in the "Format" tab of the description window of the report.
  12. Select the skin template of the report if necessary.
  13. Enter the name and title of the report (name of the ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
    WinDev You also have the ability to specify whether the report can be modified by the end user in "Reports & Queries".
  14. Validate the report creation.
  15. The report editor automatically proposes to change the format of the report if the following conditions are fulfilled:
    • the report currently created includes a table.
    • the report format does not allow to display all the table columns.
  16. Specify (if necessary) the mode for reducing the report size:
    • 19版本和更高版本
      Print the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details.
      19新版本
      Print the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details.
      Print the report on several pages. In this case, the end user will have to group the pages. See Multi-page print for more details.
    • Use the landscape mode.
    • Reduce the size of the report. Caution: according to the reduction percentage, the printed report may become unreadable.
  17. The report currently created is displayed in the report editor.

Printing a report on a Table control

Printing a report on a Table control

A report on a Table control must be printed from the window displaying the Table control to print. If the button was not created automatically, you must:
  1. Create a button in the window (or page) containing the Table control.
  2. Configure the destination of the report print:
  3. Specify the name of the report to print with 打印报表.
Notes:
  • If additional parameters must be passed to the report, these parameters must be specified in 打印报表, after the name of the report to print. See Report with parameters for more details.
  • WinDev If the window containing the Table control, source of the report, is opened several times (non-modal opening by 打开子窗口), the full name of the Table control to print must be passed in parameter to the report. For example:
    // The ..全名 property will contain the name of the window
    // that must be opened with an alias to distinguish between each window
    打印报表RPT_Customer_TableTABLE_Customer..全名)

    // Opening code of report:
    过程RPT_Customer_TableNameSourceTable
    我的报表..数据源名称=NameSourceTable
  • WinDev ..仅选定行 is used to find out and modify the records that will be printed in the report: print all the records or the selected records only.

ImportantIn Reports & Queries, a report can be printed:
  • by starting a print ().
  • by running the report test ().
Therefore, no programming is required to print the report.

WinDev

WinDev and WinDev Mobile example

The information to print is contained in the Table control named "TABLE_CustomerTable" found in the "WIN_Customer" window.

The report to print is named "RPT_Customer" and it is printed during a click on the "BTN_Print" button.

In this example, the click code of the "BTN_Print" button is as follows:

In WinDev:

// Open the preview window
打印预览()
// Print the report based on the "TABLE_Customer" control
打印报表RPT_Customer

In Windows Mobile:

// Select the printer
打印配置()
// Print the report based on the "TABLE_Customer" control
打印报表RPT_Customer