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

Glossary Item Box

SSSortEx Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Sets the sort parameters and performs a sort on the specified data.

Syntax

C

BOOL SSSortEx(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, WORD wSortBy, LPSS_SORTKEY lpSortKeys, short nSortKeyCnt);

C++

BOOL TSpread::SortEx(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, WORD wSortBy, LPSS_SORTKEY lpSortKeys, short nSortKeyCnt);

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.)
wSortBy Sort rows or columns
Choose one of the following values:
Constant Description
SS_SORT_ROW Sort rows
SS_SORT_COL Sort columns
lpSortKeys Specifies an array of SS_SORTKEY structures
nSortKeyCnt Total number of sort keys

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. To determine the settings you want for the Col, Row, Col2, and Row2 parameters, see Using Column and Row Properties.

Remarks

Call the SSSortEx function instead of the SSSort function if you want to sort by more than three sort keys. You can sort by up to 256 sort keys by calling the SSSortEx function.

Specify the block of columns and rows to sort and whether to sort in ascending or descending order by creating an array of SS_SORTKEY structures.

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 SSSortEx 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, SSSort functions

SS_SORTKEY structure

ActiveX Correspondence

SortKey property
Sort method

Copyright © GrapeCity, inc. All rights reserved.