Datasheet::GetReportTree

Description

Find the report tree in the worksheet.

Syntax

BOOL GetReportTree( TreeNode & tr, uint * pReportUID = NULL, int nReport = 0, int nType = GRT_TYPE_RESULTS, BOOL bTranslate = FALSE )

Parameters

tr
[output] the tree that was used in SetReportTree
pReportUID
[output] if not NULL to receive the UID of the report range.
default is NULL.
nReport
[input] if the sheet has multiple report, can specify a sub report.default is 0.
nType
[input] A report might also have corresponding tree branches that are not shown, like GRT_TYPE_GUI branch that can also be obtained with this function
bTranslate
[input] whether to translate the escaped operation strings in the returned tree or not.

Return

true if the sheet has the requested report, false if not found

Examples

EX1

//Get the reporttree in the active worksheet and print it out.
int DataSheet_GetReportTree_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if( wks )
    {    
        uint uid;
        Tree tr;
        if( wks.GetReportTree(tr, &uid, 0, GRT_TYPE_RESULTS, true) )
        {        
            string strOut;
            tree_to_str(tr, strOut); // translate from result tree to string, print this string you will see it as a table format
            out_str(strOut);
        }
    }
    return 0;
}

Remark

See Also

header to Include

origin.h