Drag  FilteredCount

Chapter 9: Methods for the DataWindow Control

Filter

Description

Displays rows in a DataWindow that pass the current filter criteria. Rows that do not meet the filter criteria are moved to the filter buffer.

Syntax

integer dwcontrol.Filter ( ) 

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. The return value is usually not used.

If dwcontrol is NULL, the method returns NULL.

Usage

Filter causes all rows to be retrieved and then it applies the filter. Even when the Retrieve As Needed option is set, the Filter method retrieves all rows before applying the filter.

Filter uses the current filter criteria for the DataWindow. To change the filter criteria, use the SetFilter method. The SetFilter method is equivalent to using the Filter command on the Rows menu of the DataWindow painter. If you do not call SetFilter to assign or change criteria before calling the Filter method, the DataWindow will default to use the criteria in the object definition.

When the Retrieve method retrieves data for the DataWindow, PocketBuilder applies the filter that was defined for the DataWindow object, if any. You only need to call Filter after you change the filter criteria with SetFilter or if the data has changed because of processing or user input.

Filter has no effect on the DataWindows in a composite report.

NoteFiltering and groups When you filter a DataWindow with groups, you might need to call GroupCalc after you call Filter.

For information on removing the filter or letting the user specify a filter expression, see SetFilter.

Examples

Example 1

This statement displays rows in dw_Employee based on its current filter criteria:

dw_Employee.SetRedraw(false)

dw_Employee.Filter()

dw_Employee.SetRedraw(true)

See also





Copyright © 2004. Sybase Inc. All rights reserved. FilteredCount

View this book as PDF