PC SOFT

WINDEV的在线文档

  • Overview
  • Adding a break
  • Overview
  • Adding a break into a report based on a data file, a query or a memory zone
  • Adding a break into a report based on a text file, a Table control or a HFSQL view
  • Break process
  • Page break
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Overview
The break is used to group the records corresponding to a sort criterion. A break can be requested for each sort criterion.

For example: to list the customers per city, sort the customers by city and by name, then specify a break on the city.

Adding a break automatically generates the Break header and 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).
Two types of breaks are available:
  • automatic break. 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.

Adding a break

Overview

The operations to perform to add a break differ according to the data source of the report.

There are two distinct cases:

  • adding a break into a report based on a data file, a query or a memory zone.
  • adding a break into a report based on a text file, a Table control or a HFSQL view.

Adding a break into a report based on a data file, a query or a memory zone

To add a break into a report based on a data file, a query or a memory zone:
  1. Select "Insert .. New break". The following window is displayed:On the "创建" pane, in the "结构" group, click "分隔条". The following window is displayed:
    The sort criteria of the report are listed on the left. The report breaks are listed on the right.
  2. To add:
    • a break based on a sort criterion: select the requested sort criterion and click the "Create a break on the selected sort criterion" button.
    • a programmed break: click the "Add a programmed break" button. The code of this programmed break must be entered in the "Break?" process of the Break header block. See "Break process" for more details.
  3. The breaks will be performed according to their display order. Modify (if necessary) this order via the arrow buttons found on the right of the table.
  4. Validate the addition of the new break.
Note: When adding a new break, the break header and footer blocks are automatically created.

Adding a break into a report based on a text file, a Table control or a HFSQL view

To add a break into a report based on a text file, a Table control or a HFSQL view:
  1. Select "Insert .. New break". The following window is displayed:On the "创建" pane, in the "结构" group, click "分隔条". The following window is displayed:
  2. Click the "Add a break" button ().
  3. To add:
    • a break based on an item: select the requested item and validate.
    • a programmed break: select "(No item)" and validate. The code of this programmed break must be entered in the "Break?" process of the Break header block. See "Break process" for more details.
  4. The breaks will be performed according to their display order. Modify (if necessary) this order via the arrow buttons found on the right of the table.
  5. Validate the addition of the new break.
Note: When adding a new break, the break header and footer blocks are automatically created.

Break process
If your report contains one or more programmed breaks, the break process is associated with the Break header block.

This process enables you to use a programmed break. Two types of programming can be implemented for the breaks:

  • the code of the break returns or ( to perform the break, to perform no break).
  • the code of the break returns the value of the break. If the value changes, the break is automatically performed by the report (see the example below).
    The value of the break can correspond to the value of an item, a report control, a variable, ...
Note: If the value of the break corresponds to the value of a report control, the returned value will be false if this block is found in the Body block of the report. Indeed, the break process is run before the controls found in the Body block are filled. In this case, you must return the value of the item linked to the control.

// -- Break code
nSupplier整数型0
// Retrieve the identifier of the supplier
nSupplier提取字符串gfsLine1TAB
// Find the name of the supplier
H读查找第一个SUPPLIERSupplierNumnSupplier
如果H找到()=,那么
// Initialize the control
SupplierNameSUPPLIER.Company
结束
// Return the identifier of the supplier
发送回nSupplier

Important: The code of the break is run only if the corresponding break is a programmed break (linked to no sort criterion).

Page break
To go to the next page after a break:
  1. Open the description window of the "Break footer" block ("Description" from the popup menu).
  2. In the "Details" tab, select "Page skip after the block".In the "GUI" tab, select "Page skip after the block".
Note: This page skip can also be performed by programming: