PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Creating the Iteration block
  • Printing an Iteration block
  • Replacing an existing block
  • Adding an additional block to the report
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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 iSubstBlock. You also have the ability to print a specific block with iPrintBlock.
Versions 19 and later
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.
New in version 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 "Creation" pane, in the "Structure" group, expand "Blocks".
    • 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 "Creation" pane, in the "Structure" group, expand "Blocks" 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
    iSubstBlock(PageHeader, Iteration)
  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 "Creation" pane, in the "Structure" group, expand "Blocks" and select "Iteration block". This block is named "Iteration".
  5. Customize the "Iteration" block like the one corresponding to the even pages.
  6. 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
    iSubstBlock(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 offer applicable 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 "Creation" pane, in the "Structure" group, expand "Blocks" 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?
    IF MySource.Promotion = True THEN
    // Print the Iteration block
    iPrintBlock("Iteration")
    END
    In the "After printing" process of the End of break block of the report, type the following code:
    // --After printing the End of break
    // Is the product currently printed in promotion?
    IF MySource.Promotion = True THEN
    // Print the Iteration block
    iPrintBlock("Iteration")
    END
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment