GroupCalc method (DataWindows)
Description
Recalculates the breaks in the grouping levels in a DataWindow.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>GroupCalc</span> ( ) |
[Web DataWindow server component]
1 |
short <span>dwcontrol</span>.<span>GroupCalc</span> ( ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>GroupCalc</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
Return Values
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
This code imports new rows from a file into the DataWindow
dw_emp and then recalculates the group breaks for dw_emp:
1 |
dw_emp.ImportFile("d:employee.txt") |
1 |
dw_emp.SetRedraw(false) |
1 |
dw_emp.SetSort("1A") |
1 |
dw_emp.Sort() |
1 |
dw_emp.<span>GroupCalc</span>() |
1 |
dw_emp.SetRedraw(true) |