|
|
|
|
|
- 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
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.
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.
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: - On the "Creation" tab, in the "Structure" group, click "Breaks". The following window appears: The sort criteria of the report are listed on the left. The report breaks are listed on the right.
- 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" ( 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?".
- 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.
- 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: - On the "Creation" tab, in the "Structure" group, click "Breaks". The following window appears:
- Click on "Add a break" ().
- 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?".
- 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.
- Validate the addition of new break.
Remark: When adding a new break, the Start of break and End of break blocks are automatically created. 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). To go to the next page after a break: - Open the description window of "Break footer" block ("Description" in the context menu).
- In the "UI" tab, select "Page break after the block".
Remark: This page skip can also be performed through programming:
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|