Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vertical Lines in Report
Message
De
05/09/2002 12:01:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/09/2002 10:58:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00697069
Message ID:
00697119
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>I am working on the report for the dbfcompare utility by Wouter and I am trying to mimic the vertical lines in a treeview control. I have modified the project to store all of the treeview nodes to records in a table and it is printing exactly as it should as far as data is concerned.
>
>In the group header I display the table name and in the detail band I display first the table's fields and the field's properties and then the tags and their expressions. The fieldname and tagname fields are placed on top of each other in the report detail band and only print depending on a conditional statement (ctype=1 for field and ctype=2 for tag). This successfully displays all field properties first and then all tag properties for each table in the report. All data displays correctly.
>
>However, I'm trying to mimic the treeview control display in the report, and I would like to draw a vertical line that extends from the group header (table name) each detail line (field or tagname). The line draws correctly from the field in the group header and extends down to each detail line correctly EXCEPT when I reach the end of the group. The vertical line continues for a small portion when the end of the group is reached and the record pointer moves on to the first record for the next group (next tablename). I cannot get the vertical line to STOP at the last record in the group.
>
>Any ideas?
>
>TIA,
>Tracy

Tracy,
I have the idea but not implememtation :) For each node also keep an integer (assuming levels wouldn't go deeper than 32 levels). Using treeview control bitset the bits where a node is a child, grandchild, grandgrand.. of a node. For your vertical lines print when use an expression like :
bittest(lnThisNodelines, 12) - 13th vertical line should dipslay or not.

However I wrote a routine to list a treeview with ASCII chars (+ - |) and that might help you finding the missing point for the 'stop' - pls note that this was in fact a class but was easier for me to write as a series of funstions here :
*sample call
StrToFile(TVLister(thisform.Treeview),'treeviewoutput.txt')

Function TVLister
  Lparameters toTV
  Local lnIndex,lnLastIndex
  _Cliptext=''

  With toTV
    lnIndex = .Nodes(1).Root.FirstSibling.Index
    lnLastIndex = .Nodes(1).Root.LastSibling.Index
    _GetSubNodes(lnIndex,toTV)
    Do While lnIndex # lnLastIndex
      lnIndex = .Nodes(lnIndex).Next.Index
      _GetSubNodes(lnIndex,toTV)
    Enddo
  Endwith
  Return _Cliptext

Function _GetSubNodes
  Lparameters tnIndex, toTV
  Local lnIndex, lnLastIndex
  With toTV
    WriteNode(tnIndex,toTV)
    If .Nodes(tnIndex).Children > 0
      lnIndex  = .Nodes(tnIndex).Child.Index
      lnLastIndex = .Nodes(tnIndex).Child.LastSibling.Index
      _GetSubNodes(lnIndex,toTV)
      Do While lnIndex # lnLastIndex
        lnIndex = .Nodes(lnIndex).Next.Index
        _GetSubNodes(lnIndex,toTV)
      Enddo
    Endif
  Endwith


Function WriteNode
  Lparameters tnCurIndex, toTV
  Local lnRootIndex, lnIndex, lcPrefix, lcKey, lnLevel
  lnIndex = tnCurIndex

  With toTV
    lnRootIndex = .Nodes(lnIndex).Root.Index
    lcPrefix = '+-' + .Nodes(lnIndex).Text

    lnLevel = 0
    Do While lnIndex # lnRootIndex
      lnIndex = .Nodes(lnIndex).Parent.Index
      lcPrefix = Iif(.Nodes(lnIndex).LastSibling.Index = ;
               lnIndex,' ','|')+Space(3)+lcPrefix
      lnLevel = lnLevel + 1
    Enddo
    _Cliptext = _Cliptext + lcPrefix + Chr(13)
  Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform