ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Report editor / Operations in the editor
  • Overview
  • Add break
  • Overview
  • Adding a break into a report based on a data file, a query or a memory area
  • Adding a break into a report based on a text file, a Table control or an HFSQL view
  • Event "Break?"
  • Page break
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 Start of break and End of break blocks. These blocks are used to:
  • display the content of the break item (usually in the Start of break block).
  • perform calculations on the records in the break (usually in the End of break 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 defined programmatically in the "Value of break" event of the Start of break block.
Add 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 area.
  • 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 area

To add a break into a report based on a data file, a query or a memory area:
  1. On the "Creation" tab, in the "Structure" group, click "Breaks". The following window appears:
    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 on "Create a break on the selected sort criterion" ().
    • a programmed break: click "Add a programmed break" (Add in the list of breaks). The code of this programmed break must be typed in the "Value of break" event of the Start of break block. For more details, see Event "Break?".
  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.
Remark: When adding a new break, the Start of break and End of break blocks are automatically created.

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

To add a break into a report based on a text file, a Table control or a HFSQL view:
  1. On the "Creation" tab, in the "Structure" group, click "Breaks". The following window appears:
    List of breaks
  2. Click on "Add a break" (Add).
  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 "Value of break" event of the Start of break block. For more details, see Event "Break?".
  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.
Remark: When adding a new break, the Start of break and End of break blocks are automatically created.
Event "Break?"
If your report contains one or more programmed breaks, the "Break?" event is associated with the Start of break block.
This event allows you to use a programmed break. Two types of programming can be implemented for the breaks:
  • the event returns True or False (True to perform the break, False not to perform the break).
  • the event returns the value of the break. 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, ...
Remark: 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 report. Indeed, the break event 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" in the context menu).
  2. In the "UI" tab, select "Page break after the block".
Remark: This page skip can also be performed through programming:
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/14/2022

Send a report | Local help