Platoo FReport ComponentsGrouping records

Contents


Description
It is customary that if the client's request returns very many data, for instance database records or URLs in the search motor, the result is broken into smaller groups and returned to the client by groups.

Upon using FR components it can be realised with the help of the TFRGroupManager component in cooperation with the TFRDataSource component. The TFRGroupManager is a container for other components that correspond to navigating in the groups. The relevant components are:

NAME FUNCTION

First First group

Next Next group

Prior Previous group

Last Last group

Group Determined group

All these elements are not compulsory. The elements are entered into the HTML document in the order of First, Prior, Group[,Group,Group],Next,Last. The group elements are entered one copy for each possible group, all the other elements are entered once.

All these elements may be simple elements like TFRButton or containers for other elements. ActionDataSource and FRDAction =GROUP_MANAGER has to be established for an actually active element ( TFRButton, TFRLabel). TFRGroupManager generates suitable ONCLICK events for such HTML elements.

NB! As the CGI mechanism is used to send requests to the server, the TFRGRoupManager has to be within the <FORM> ... </FORM> HTML element, thus be on the TFRForm component.

As the server must create the same request again to send each group to the client, all the request parameters must be available. Use TFReport.ParamNames property which lists all the necessary parameters to ensure that, and place the TFRHidden components on the form, one for each request parameter, whereas set the ReportParam property of the Hidden component to correspond to the request parameter's name, and set the AutoName as true.

To create the Caption of the Group element use the TFRGroupManager.GroupBegin and TFRGroupManager.GroupEnd property - they include the numbers of the first and last record of the group that correspond to the Group element being generated. The numbers of the first and last record currently added to the document are available from the TFRDataSource.GroupBegin and TFRDataSource.GroupEnd properties respectively. The total number of records corresponding to the request is available in the TFRGroupManager.RecordCount property.