Spread 8.0 Documentation
SSGetData, SSSetData, SSSetDataRange Functions
Support Options
DLL Reference > DLL Functions > SSGetData, SSSetData, SSSetDataRange Functions

Glossary Item Box

SSGetData, SSSetData, SSSetDataRange Functions


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Set or return data in a cell, a column, a row, or the entire sheet, or set data in a block of cells.

Syntax

C

int SSGetData(HWND hWnd, SS_COORD Col, SS_COORD Row, LPTSTR Data);

BOOL SSSetData(HWND hWnd, SS_COORD Col, SS_COORD Row, LPCTSTR lpData);

BOOL SSSetDataRange(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPCTSTR lpData);

C++

int TSpread::GetData(SS_COORD Col, SS_COORD Row, LPTSTR Data);

BOOL TSpread::SetData(SS_COORD Col, SS_COORD Row, LPCTSTR lpData);

BOOL TSpread::SetDataRange(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPCTSTR lpData);

Parameters

The following parameters are available:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of cell or column number of upper-left cell of the block if specifying a block for the SSSetDataRange function
Row Row number of cell or row number of upper-left cell of the block if specifying a block for the SSSetDataRange function
Col2 Column number of lower-right cell of the block if specifying a block for the SSSetDataRange function
Row2 Row number of lower-right cell of the block if specifying a block for the SSSetDataRange function
Data Pointer to string to or from which the cell's data is written

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

Use the SSSetDataRange function to set the data for a block of cells.

Supply data using the SSSetData or SSSetDataRange function in the format in which it is to be displayed. The following table explains the data format to use when setting data, and the format returned when returning data. Values in quotation marks (" ") are string values.

Cell Type Sample Data Set or Return Data
Button True (Two-state) "1"
False (Two-state) "0"
Not set (Two-state; looks False) Empty string
Check Box True "1"
False "0"
Grayed "2"
Not set; looks False Empty string
Combo Box Text string of selected item
Currency "$10,000.00" "$10,000.00"
Date "10/29/2001" "10/29/2001"
When setting, provide in format that matches the the format specified by the SSSetTypeDate function. Use a separator where separators are displayed in the format.
Edit Text string
If the SSSetTypeEdit function's Style parameter is set to ES_MULTILINE, a linefeed character ('\n' in C++) can be used to force a line break when setting text.
Number "10,000.00" "10,000.00" or "1E4"
Owner-Drawn not applicable
Percent "15%" "15%"
PIC "22-45-76" "22-45-76" or "22 45 76" where space is used instead of typing the placeholder character for setting data
Picture not applicable
Scientific "2.22E+05" "2.22E+05"
Static Text Text string
If the SSSetTypeStaticText function's TextStyle parameter is set to SS_TEXT_WORDWRAP, a linefeed character ('\n' in C++) can be used to force a line break when setting text.
Time "11:25:03 pm" "11:25:03 pm"
When setting and using an a.m./p.m. indicator, include a space between the time value and the indicator, for example, "10:00:00 p.m."

When using the SSSetData or SSSetDataRange functions, if the data does not match the requirements of the cell types, the values do not change.

If you set the Col or Row parameter to SS_ALLCOLS or SS_ALLROWS or you call the SSSetDataRange function to set data for multiple cells, the same data is placed in each cell. If you set the Col or Row parameter to SS_ALLCOLS or SS_ALLROWS to return data from multiple cells, unless the cells were set with the Col or Row parameter set to SS_ALLCOLS or SS_ALLROWS, the function does not return a value.

Note: The SSGetData function does not return the text in a column or row header cell unless the cell contains custom text. The function does not return the auto text in the header cells.

Use the SSClipIn function rather than the SSSetData function for setting large amounts of data. Use the SSSetValue function to set unformatted data.

Return Value

SSGetData: Length of the Data string.
SSSetData, SSSetDataRange: TRUE if the function completes successfully; FALSE otherwise.

See Also

Adding Data
Returning Data
Specifying Header Text

SSClipIn, SSClipOut, SSGetFloat, SSGetInteger, SSGetValue, SSSetFloat, SSSetFloatRange, SSSetInteger, SSSetIntegerRange, SSSetSheet, SSSetValue, SSSetValueRange functions

ActiveX Correspondence

SSGetData: Text property
GetText method

SSSetData: Text property
SetText method

SSSetDataRange: Text property

Copyright © GrapeCity, inc. All rights reserved.