LPARAMETERS tcNodeKey, tnIndent LOCAL lnNodeIndex insert into tmpCursor values (ThisForm.oleTree.Nodes(tcNodeKey).text, tnIndent) if ThisForm.oleTree.Nodes(tcNodeKey).Children > 0 lnNodeIndex = ThisForm.oleTree.Nodes(tcNodeKey).Child.Index ThisForm.RecurseTreeNodes(ThisForm.oleTree.Nodes(lnNodeIndex).Key, tnIndent + 1) do while lnNodeIndex <> ThisForm.oleTree.Nodes(tcNodeKey).Child.LastSibling.Index lnNodeIndex = ThisForm.oleTree.Nodes(lnNodeIndex).Next.Index ThisForm.RecurseTreeNodes(ThisForm.oleTree.Nodes(lnNodeIndex).Key, tnIndent + 1) enddo endifThen all you have to do is invoke something like this (from a button or other interface object).
create cursor tmpCursor (nodetext C(100), indent I) ThisForm.RecurseTreeNodes(ThisForm.oleTree.Nodes(1).Key, 0) if reccount("tmpCursor") > 0 report form treedump preview endifYou will notice the "treedump" report which uses the tmpCursor values to display the treeviews contents. In its simplest form this report contains 1 field with an expression to simulate indentation.
replicate(" ", tmpCursor.indent) + tmpCursor.nodetextHTH