Minimum Origin Version Required: Origin 8 SR0
The following example try to get the report tree associated with hierarchical worksheet and output the tree in LabTalk console in Code Builder.
Worksheet wks = Project.ActiveLayer(); //assume the hierarchical worksheet is active
if ( _get_wks_report_tree(wks, trReport) ) //if the active worksheet has report tree associated with it, output the tree
out_str("There is no report tree associated with the active worksheet!");
static bool _get_wks_report_tree(Worksheet& wks, TreeNode& trReport)
if ( !wks || !trReport )
if ( !wks.GetReportTree(trReport, NULL, 0, GRT_TYPE_RESULTS, TRUE) ) //get the first report on worksheet