PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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
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 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 by city, sort the customers by city then by name, and specify a break on the city.
Report with break
Adding a break automatically generates the Break header and footer blocks. These blocks are used to:
  • display the content of 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 report.
  • programmed break. The break is entirely defined by programming in the "Break?" process of Break header block.
Adding a break

Overview

The operations to perform to add a break differ according to the data source of 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 "Creation" pane, in the "Structure" group, click "Breaks". The following window is displayed:
    Managing sorts and breaks
    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 typed in the "Break?" process of 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 table.
  4. Validate the addition of 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 "Creation" pane, in the "Structure" group, click "Breaks". The following window is displayed:
    List of breaks
  2. Click the "Add a break" button ( Addition ).
  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 typed in the "Break?" process of 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 table.
  5. Validate the addition of 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 allows you to use a programmed break. Two types of programming can be implemented for the breaks:
  • the break code returns True or False (True to perform the break, False not to perform the break).
  • the break code returns the break value. If the value changes, the break is automatically performed by the report (see the example below).
    The break value can correspond to the value of an item, a report control, a variable, ...
Note: If the break value 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 filling the controls found in the Body block. In this case, you must return the value of item linked to the control.
// -- Break code
nSupplier is int = 0
// Retrieve the supplier identifier
nSupplier = ExtractString(gfsLine, 1, TAB)
// Find the supplier name
HReadSeekFirst(SUPPLIER, SupplierNum, nSupplier)
IF HFound() = True THEN
// Initialize the control
SupplierName = SUPPLIER.Company
END
// Return the supplier identifier
RESULT 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 "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 break after the block".
Note: This page skip can also be performed by programming:
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment