2.2.4.12.27 Datasheet::Transpose

Description

Transpose data in a sheet

Syntax

int Transpose( BOOL bSel = false, int nExchangeLabel = RCLT_INVALID, BOOL bInsertCol = true, BOOL bUndo = false )

Parameters

bSel
[input] true will transpose selection only and nExchangeLabel is ignored
nExchangeLabel
[input] the type of column label, which will be exchanged with col(1) or new col
bInsertCol
[input] when exchange label, insert new col or use col(1)
bUndo
[input] Whether to support Undo (TRUE) or not (FALSE).
Its default value is FALSE.

Return

0 if no error, otherwise <0 error codes

Examples

EX1

//Transpose the active worksheet.
void Datasheet_Transpose_Ex1(int nLabelType = RCLT_LONG_NAME, BOOL bInsertCol = true, BOOL bUndo = false)
{
    Worksheet wks = Project.ActiveLayer();
    
    if(!wks)
    {
        out_str("Active Window is not a Workbook");
        return;
    }
                
    int nn = wks.Transpose(false, nLabelType, bInsertCol, bUndo);
    if(nn == 0)
        printf("Workbook %s is transposed\n", wks.GetName());
    else if(nn < 0)
        printf("Failed to transpose workbook %s.", wks.GetName());    
}

Remark

See Also

Header to Include

origin.h