Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vertical Lines in Report
Message
From
05/09/2002 12:19:08
 
 
To
05/09/2002 12:01:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00697069
Message ID:
00697130
Views:
17
Thanks Cetin,

Your program works great! That's exactly what I was looking for BEFORE I created the .frx but I couldn't find anything even close to it or anyone that thought it was possible to produce a report from a treeview.

However, since I couldn't find anything when I started this, I did create an .frx and one of the benefits of the .frx is that I color coded the nodes in the report (green for fields that exist in the tables in the first directory but not the 2nd dir, and yellow for fields that exist in the tables in the 2nd dir but not the first, etc) to match the form display. A .txt file doesn't have that capability and I would like to include it to make it easier when viewing the report as to which directory has what differences in the tables.

However, I would like to include your code to print an ascii representation of the treeview also as an option if that is ok with you?

Any ideas how I can get the vertical lines to print in the .frx? I'm using the linedraw button and it works great except the last detail line in the detail band doesn't stop the vertical line. The vertical line continues on to the next detail line (1 more only) that does not exist and then it ends when the next group starts. Hence, a short extension is visible on the last record in the group everytime. Not a clean break.

Thanks!

Tracy

>>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform