2.1.13.9 GetSPCSubHeader


Description

Get SPC subheader information from worksheet. This function requires the subheader counter from the main header structure. Therefore, the OSPCMAINHeader information has to be retrieved successfully first to be able to use this function.

Syntax

BOOL GetSPCSubHeader( LPCSTR lpcszWksName, int nCol, OSPCSUBHeader * SPCSubHeader, int nIndex )

Parameters

lpcszWksName
[input] Worksheet name
nCol
[input] Column index from 0
SPCSubHeader
[output] SPC sub header structure
nIndex
[input] The index of subheader from 0

Return

TRUE means the subheader information is retrieved successfully

FALSE indicates the failure in retrieving subheader information

Examples

EX1

// Assume a Worksheet exists in the project
int    OKdll_GetSPCSubHeader_Ex1()
{
    string            strWks = Project.WorksheetPages(0).GetName();
    Worksheet        wks(strWks);
    OSPCMAINHeader    spcMainHeader;
    int                iNumOfSubs;
    for(int jj = 0; jj< wks.GetNumCols();jj++)
    {
        if( GetSPCMainHeader(strWks, jj, &spcMainHeader) )
        {
            //read information from the main header
            iNumOfSubs = spcMainHeader.fnsub;
            OSPCSUBHeader spcSubHeader;
            for( int ii = 0; ii < iNumOfSubs; ii++ )
            {
                if( GetSPCSubHeader(strWks, jj, &spcSubHeader, ii) )
                    //read information from the subheader
                    printf("%u\n", ii);
            }
        }    
        string    strLog;
        strLog = GetSPCLog(strWks, jj);
    }
    return iNumOfSubs;
}

Remark

See Also

Header to Include

origin.h

Reference