PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Add 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
  • Event "Break?"
  • 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 event "Break?" of the Break header 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 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 on "Create a break on the selected sort criterion" ( ).
    • a programmed break: click on "Add a programmed break" ( Add in the list of breaks). The code of this programmed break must be typed in the event "Break?" of the Break header block. See Event "Break?" 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 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 event "Break?" of the Break header block. See Event "Break?" 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.
Event "Break?"
If your report contains one or more programmed breaks, the event "Break?" is associated with the Break header 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, ...
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 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" from the popup menu).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 "UI" tab, select "Page break after the block".
Note: This page skip can also be performed by programming:
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment