Worksheet::SetColFormats

Description

Sets the column formats in a worksheet.

Syntax

BOOL SetColFormats( LPCSTR lpcszFormats, BOOL bRepeat = TRUE )

Parameters

lpcszFormats
[input] String containing packed numbers indicating column Format for all columns in worksheet
bRepeat
[input] Repeat entire pattern over remaining columns (TRUE) or set designations for the rest of columns to be the last one defined by pattern (FALSE);
default is TRUE.

Return

TRUE on success, FALSE on failure.

Examples

EX1

// the following code will set column formats in a new worksheet
// 1st column - Numeric (0)
// 2nd column - Text    (1)
// 3rd column - Time    (2)
// 4th column - Date    (3)
// 5th column - Text and Numeric (9)
void Worksheet_SetColFormats_Ex1()
{
    Worksheet wks;
    wks.Create("origin", CREATE_VISIBLE);
    wks.AddCol();
    wks.AddCol();
    wks.AddCol();
    string strFormats="01239";
    wks.SetColFormats(strFormats);
}

Remark

See Also

Worksheet::GetColFormats

header to Include

origin.h