Creating treeview similar to reporter explorer

Hello, i’m trying to code a treeview in VB which must be exactly the same than Reporter’s explorer. but i have a problem to access the good variables and formulas.

For example : this is Reporter Treeview :

and this is how my program looks like :

as you can see, i can recreate the variables “Variables” by using this this code :


   Dim nodX As Node   
   TreeView1.Nodes.Add(, , "r", "Racine") = "Variables"
 Dim nbvariables As Integer
 nbvariables = RapportBO.DocumentVariables.Count
For i = 1 To nbvariables
If RapportBO.DocumentVariables.Item(i).Qualification = boDimension Or boDimension And RapportBO.DocumentVariables.Item(i).Name <> "" Then
TreeView1.Nodes.Add("r", tvwChild) = (RapportBO.DocumentVariables.Item(i).Name)
End If

but I can’t recreate exactly the formulas “Formules” as in reporter because i don’t know how to distinguish hidden formulas, unused formulas, etc…

For example, in reporter in the node “Formules”, I only have “=Nombre()”, but in my VB treeview, i also have 11 more formulas ("=Page0" for example), but i don’t want these ones.

Any idea ?


bleepsarace (BOB member since 2004-07-30)

We recently had a similar discussion here. I haven’t found a way to figure out which are “real” either.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

you’re right, i didn’t realised someone else had the same problem.
But if this problem is impossible to solve, is it possible to ditinguish in any way between dimensions and indicators or informations ?

Thks for your answer.


bleepsarace (BOB member since 2004-07-30)

This doesn’t solve all of your problems, but this code can help find “named” variables that have been deleted:

Dim DVs As DocumentVariables
Dim DV1 As DocumentVariable, DV2 As DocumentVariable
Set DVs = ThisDocument.DocumentVariables
For Each DV1 In DVs
    If DV1.Name <> "" Then
        Set DV2 = DVs(DV1.Name) '<<=== this line will fail for deleted items
    End If
Next DV1

Maybe it will give you some ideas, at least


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thank you :smiley:


bleepsarace (BOB member since 2004-07-30)