Worksheet::SetCells

Contents

Description

Remarks put a group of values into a row in worksheet

Syntax

BOOL SetCells( const vector<string> & vsValues, int nRow = -1, int nC1 = 0, BOOL bConsiderNumeric = true )

Parameters

vsValues
[input] values to set, any string that can be converted to numeric will be converted and set as numeric
nRow
[input] -1 to append to last row for column nC1
nC1
[input] starting column index to set the row of values
bConsiderNumeric
[input] when true, check lpcszText and set as numeric including "--" to become numeric missing value

Return

TRUE for success, otherwise return false.

Examples

EX1

//Remarks put a group of values into a row in worksheet. 
void Worksheet_SetCells_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    Worksheet wks(wp.GetName());
    
    vector<string> vsValues;
    for(int ii = 0; ii < 10; ii++)
    {
        vsValues.Add(ftoa(ii));
    }
    
    if( wks.SetCells(vsValues) )
        printf("Success to set worksheet cell values!");
    else
        printf("Fail to set cell values!");
}

Remark

See Also

Datasheet::SetCell

header to Include

origin.h