PC SOFT

WINDEV的在线文档

  • Overview
  • Creating the Iteration block
  • Printing an Iteration block
  • Replacing an existing block
  • Adding an additional block to the 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本地访问

Overview
The Iteration block is a free block, created manually in the report editor. It can be used like any other type of block. For example, an Iteration block can be used to replace a Page header block to identify the even pages and the odd pages.The Iteration block is a free block, created manually in the report editor. It can be used like any other type of block. For example, an Iteration block can be used to replace a Page header block in order to differentiate between the even pages and the odd pages.

The block substitution is performed by programming with 打印替换块. You also have the ability to print a specific block with 打印块.

19版本和更高版本
Note: The planes are available in the reports from version 19. In most cases, using planes in the reports allows you to replace the iteration blocks. Using planes in the reports is easier than using iteration blocks. See The planes for more details.
19新版本
Note: The planes are available in the reports from version 19. In most cases, using planes in the reports allows you to replace the iteration blocks. Using planes in the reports is easier than using iteration blocks. See The planes for more details.
Note: The planes are available in the reports from version 19. In most cases, using planes in the reports allows you to replace the iteration blocks. Using planes in the reports is easier than using iteration blocks. See The planes for more details.

Creating the Iteration block
To create an Iteration block:
  1. Perform one of the following operations in the report editor:
    • select "Insert .. New block".on the "创建" pane, in the "结构" group, expand "块".
    • select "Add a block" from the popup menu of the report (right mouse click on the report currently created).
    • click the "Add a block" button in the "Blocks" tab of the report description.
  2. Select the "Iteration block" type.

Printing an Iteration block
An Iteration block is used to:
  • replace an existing block.
  • add an additional block to the report.

Replacing an existing block

The programming required to replace an existing block is illustrated by the following example:

The page header of my report must differ for the even pages and for the odd pages.
The Page header block corresponds to the odd pages (it will be printed on page 1, 3, 5 ...). Therefore, this block will be printed on the first page of my report.
The Iteration block corresponds to the even pages.

  1. Add (if necessary) a Page header block ("Insert .. New block .. Page header"). This block is named "PageHeader".Add (if necessary) a Page header block: on the "创建" pane, in the "结构" group, expand "块" and select "Page header". This block is named "PageHeader".
  2. Customize the "PageHeader" block like the one corresponding to the odd pages.
  3. In the "After printing" process of the "PageHeader" block, enter the following code:
    // --After printing the PageHeader
    // Substitute the PageHeader block by the
    // Iteration block on the next page of my report
    打印替换块PageHeaderIteration
  4. Add (if necessary) an Iteration block ("Insert .. New block .. Iteration block"). This block is named "Iteration".Add (if necessary) an Iteration block: on the "创建" pane, in the "结构" group, expand "块" and select "Iteration block". This block is named "Iteration".
  5. Customize the "Iteration" block like the one corresponding to the even pages.
    In the "After printing" process of the "Iteration" block, enter the following code:
    // --After printing the Iteration
    // Cancel the substitution of the PageHeader block
    // by the Iteration block on next page of my report
    打印替换块PageHeader""

Note: To substitute a Page footer block, we recommend that you use blocks of same height to avoid any print problems.

Adding an additional block to the report

The programming required to add an Iteration block is presented in the following example:The "RPT_ProductReport" report prints the description of each product (a break is performed on "ProductNum"). A promotion is available for some products. In this case, the "Promotion" item of the "Product" file corresponds to True. This item is a boolean.
For the products in promotion, the "Iteration" block is added to the report. This block describes the type of promotion that is applied to the product (buy two for the price of one, 20% off, ...).

  1. Add (if necessary) an Iteration block ("Insert .. New block .. Iteration block"). This block is named "Iteration".Add (if necessary) an Iteration block: on the "创建" pane, in the "结构" group, expand "块" and select "Iteration block". This block is named "Iteration".
  2. Customize the "Iteration" block.
  3. In the "After printing" process of the Break footer block of the report, enter the following code:
    // --After printing the break footer
    // Is the product currently printed in promotion?
    如果我的数据源.Promotion,那么
    // Print the Iteration block
    打印块"Iteration"
    结束