GroupCalc

Description

Recalculates the breaks in the grouping levels in a DataWindow.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Web

Server component

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

PowerBuilder

integer dwcontrol.GroupCalc ( )

Web DataWindow server component

short dwcontrol.GroupCalc ( )

Web ActiveX

number dwcontrol.GroupCalc ( )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow

Returns

Returns 1 if it succeeds and –1 if an error occurs.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

Use GroupCalc to force the DataWindow object to recalculate the breaks in the grouping levels after you have added or modified rows in a DataWindow.

GroupCalc does not sort the data before it recalculates the breaks. Therefore, unless you populated the DataWindow in a sorted order, call the Sort method to sort the data before you call GroupCalc.

Examples

Example 1

This code imports new rows from a file into the DataWindow dw_emp and then recalculates the group breaks for dw_emp:

dw_emp.ImportFile("d:\employee.txt")

dw_emp.SetRedraw(false)

dw_emp.SetSort("1A")

dw_emp.Sort()

dw_emp.GroupCalc()

dw_emp.SetRedraw(true)

See also