Spread 8.0 Documentation
SSSort Function
Support Options
DLL Reference > DLL Functions > SSSort Function

Glossary Item Box

SSSort Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Sorts a block of cells using the quick sort method.

Syntax

C

BOOL SSSort(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPSS_SORT lpSort);

C++

BOOL TSpread::Sort(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPSS_SORT lpSort);

Parameters

The following parameters are available:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of first column of block
(Value can be SS_ALLCOLS to sort only columns.)
Row Row number of first row of block
(Value can be SS_ALLROWS to sort only rows.)
Col2 Column number of last column of block
(If Col is SS_ALLCOLS, this value is ignored.)
Row2 Row number of last row of block
(If Row is SS_ALLROWS, this value is ignored.)
lpSort Pointer to SS_SORT structure to set up sort criteria

To determine the settings you want for the Col, Row, Col2, and Row2 parameters, see Using Column and Row Properties.

Remarks

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.

The application controls the sort order as well as the rows or columns that are used as the key references.

If you set the Col (or Row) parameter to 0 and the Col2 (or Row2) parameter to –1 and perform a sort by row (or column), the row (or column) item data will move.

Notes:
  • You cannot sort a sheet that is using virtual mode or that has spanned cells.
  • Button, check box, combo box, and picture cells are sorted by the value that would be returned by the SSGetData function.
  • If you sort by the column header and perform a sort by row, the row item data will move. If you sort by the row header and perform a sort by column, the column item data will move. Perform a sort on the column or row header by calling the SSSort function and setting the Col (or Row) parameter to 0 and the Col2 (or Row2) parameter to SS_ALLCOLS (or SS_ALLROWS).
  • The control does not update cell references in formulas when you sort blocks of cells.

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

Sorting Data

SSGetData, SSSetSheet, SSSortEx functions

SS_SORT structure

ActiveX Correspondence

SortKey, SortKeyOrder properties
Sort method

Copyright © GrapeCity, inc. All rights reserved.