PC SOFT

WINDEV的在线文档

  • Overview
  • Creating a report
  • The different wizard steps
  • The different types of reports
  • The available data sources
  • Breaks and sorts
  • Performing calculations in a report
  • Skin template
  • Print format of the report
  • Saving a report
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Creating a report

Overview
The report editor allows you to easily create all types of reports via a wizard.

The reports created with the report editor can be printed:

  • from the WinDev applications (Windows or Linux).
  • from the WebDev sites (Windows or Linux).
  • from the Windows Mobile applications.
  • 18版本和更高版本
    from the iOS applications.
    18新版本
    from the iOS applications.
    from the iOS applications.

Creating a report
To create a report:
  1. Select "File .. New .. Report".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. Specify:
    • the type of report to create (form, table, ...). See Types of reports for more details.
    • the data source of the report (data file, query, ...). See Data source of a report for more details.
    • the report elements (controls, sort conditions, breaks, ...).
  3. Validate the report creation. The report is generated and saved according to the selected options.
These different steps are performed in the wizard for report creation. A report corresponding to the selected options is automatically created at the end of the wizard. The created report appears in edit in the report editor. The different blocks and controls of your report have been created. They can be modified according to your own requirements. Most of the options chosen when creating the report can be modified thereafter.

Then, the report can be run:

  • from the report editor,
  • from a WinDev application,
  • from a WinDev Mobile application (for Windows Mobile or iOS),
  • from a WebDev site.

The different wizard steps

The different types of reports

Several types of reports can be created in the report editor. All of them are available in the user version of the report editor and in the standard report editor.

The following types of reports are available:

  • Blank report.
  • Form report.
  • Table report.
  • Crosstab report.
  • 19版本和更高版本
    TreeView Table report.
    19新版本
    TreeView Table report.
    TreeView Table report.
  • 19版本和更高版本
    Gantt Chart report (not available in WinDev Mobile).
    19新版本
    Gantt Chart report (not available in WinDev Mobile).
    Gantt Chart report (not available in WinDev Mobile).
  • 17版本和更高版本
    Organizer report (not available in WinDev Mobile).
    17新版本
    Organizer report (not available in WinDev Mobile).
    Organizer report (not available in WinDev Mobile).
  • 17版本和更高版本
    Scheduler report (not available in WinDev Mobile).
    17新版本
    Scheduler report (not available in WinDev Mobile).
    Scheduler report (not available in WinDev Mobile).
  • Custom Mailing report (not available in WinDev Mobile).
  • Label report.
  • Report on Form.
  • 15版本和更高版本
    Multicolumn report.
    15新版本
    Multicolumn report.
    Multicolumn report.
  • 16版本和更高版本
    Composite report.
    16新版本
    Composite report.
    Composite report.
  • Chart report (not available in WinDev Mobile).
  • Table + Chart report (not available in WinDev Mobile).

See Types of reports for more details.

The available data sources

The data source of the report defines the origin of the data printed in the report. Several data sources are available. These data sources can be selected in the wizard for report creation or in the description window of the report.

The available data sources are as follows:
  • Data file: The data to print comes from a data file described in the project analysis. This data file can have any format (HFSQL Classic, Oracle, ...).

ImportantThe data files and the file items that can be used in the reports created by Reports & Queries are defined by the developer in the data model editor. See Distributing Reports & Queries for more details.

  • Query: The data to print comes from a query. This query corresponds to:
    • a query created and saved in the query editor.
    • a query created when creating the report.
  • Table, TreeView Table, Organizer or Scheduler control found in a window or in a page: The data to print comes from a specific control found in one of the application windows or in one of the site pages. The records are selected by the control and they are printed by the report.

ImportantReports & Queries cannot be used to create reports on a Table control, a TreeView Table control, an Organizer control or a Scheduler control. However, you have the ability to customize the reports on a Table, TreeView Table, Organizer or Scheduler control created in the standard report editor (color, fonts, size, linked column, ...).

  • Existing variable : The data to print comes from a WLanguage variable found in the project or in the report. This variable can be a simple array, a member of classes, a member of structures or a member of advanced variables.

ImportantReports & Queries cannot be used to create or modify the reports on variable.

  • SQL query via a connection (ODBC, Native Accesses, ...) (not available in WinDev Mobile): The data to print comes from a database accessible via a specific ODBC driver, via a Native Access, ... The SQL query is defined when the report is created.
    Note: This type of source is not available in the wizard for report creation.
  • No data source: The report will be linked to no data source.

Other available data sources

  • Text file: The data to print is read in a text file.
  • Memory zone (not available in WinDev Mobile): The data to print corresponds to the records stored in a memory zone.

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

  • View on a HFSQL Classic data file: The data to print comes from a HFSQL view.

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

  • Programmed reading of the data source: To manually program and select the records that will be displayed in the report, choose a report based on a programmed data source. See Report on a programmed data source for more details.

ImportantReports & Queries cannot be used to create reports on a programmed data source.

These data sources are presented in Data sources.

Note: If one of the above-mentioned data sources is selected, the records that will be displayed in the report are automatically selected by the report editor.
To manually program and select the records that will be displayed in the report, choose a report with programmed reading of the data source.

Breaks and sorts

The breaks and the sorts are used to define the sort order of the data printed in the report as well as the options for grouping the data.
  • If the report is based on a data file, the search items of the data file are automatically proposed as sort items.
  • If the report is based on a query, the sorts performed in the query are automatically proposed for the breaks.
  • If the report is based on a variable, only the breaks can be defined: the sorts must be performed by programming.

The sort
To make the result of a query easier to read, the records can be sorted according to one or more items. Sorting the records means classifying them in an ascending order or in descending order.
For example, the customers can be sorted by name, from A to Z.
If your report is based on a query, the sort order is defined when creating the query. However, you have the ability to:
  • add or delete a sort item to/from an existing report.
  • modify the sort order performed on an item in an existing report.
To improve the sort, you also have the ability to use:
  • the WLanguage functions (左边取值, 右边取值, ...).
  • a WLanguage procedure (server procedure in WebDev). This procedure will be automatically called to sort the records displayed in the report. This procedure must be a global procedure of the project or a local procedure of the report. See Sort procedure for more details.

The breaks
The break is used to group the records corresponding to the same sort argument.
For example:
  • to list the stock price by day, sort the stocks by date and perform a break on the date.
  • to list the customers and the companies by city, sort the customers by city then by company name, and perform a break on the city.
Adding a break automatically generates the Break Header and Break Footer blocks. These blocks are used to:
  • display the content of the break item (in the Break Header block).
  • perform calculations on the records found in the break (in the Break Footer block).
See Report blocks for more details.

The report editor proposes two types of breaks:

  • automatic break (the most common one). The break is performed on an item belonging to the data source of the report.
  • programmed break. The break is entirely defined by programming in the "Break?" process of the Break Header block.
See Breaks in a report for more details.

Performing calculations in a report

Several calculations can be performed on the numeric data found in a report. For example, in a report used to list the orders per customer, you can calculate and display the average value of the customer orders.

Note: The different calculations performed in a report are defined when the report is created. However, new calculations can be added to the created report via the calculated controls.

Skin template

If the project is associated with a skin template (or with a template), this skin template (or this template) can be selected for your reports. Your reports and your application will have the same style. This skin template (or template) can be modified once the report is created.

Caution: Depending on the type of printer, the reports containing images may take quite a long time to print.

Print format of the report

The format of a report is used to configure:
  • the orientation of the report.
  • the paper format.
  • the print margins.
  • the number of columns in the report. By default, a report contains one column. If the report contains more than one column, the report is said to be "multi-column".

For a "Label" report, you also have the ability to configure:

  • the format of the label sheet.
  • the spacing between the labels.
This information can be modified once the report is created. See Describing and handling a report for more details.

Saving a report

To save a report, select "File .. Save".To save a report:
  • on the "首页" pane, in the "常规" group, click "保存".
  • clickamong the quick access buttons.
The extension of the created report file is ".WDE".

The report is automatically included in the list of project elements.

If you are using the report editor, the reports will be included in the library:

  • WinDev when creating the executable.
另见