Does anybody know how to set the header information for each level of a
datawindow in the treeview presentation style. I only can set trailer
information for each level and a header for the whole datawindow.
Regards,
Bruno Herndler
Usually if you change the fields (columns) in the headers,
you would be changing the treeview level.
in the following example, the code changes group 1, treeview
level equal to dept_id: dw_1.setitem(1,
'department_dept_id',1111)
note: by changing the level you made it into another branch.
It doesn't make sense to change the columns in the treeview
header.
If you want to put a dummyfield in the header, then change
it... you change the same way as you change the trailer:
instead of finding the last row in the group, find the first
row, then change the dummyfield for that row.
For example in a group or treeview datawindow I put a
dummyfield in the resultset
Select .... space(20) as dummyvalue from ....
now in the datawindow I can scroll thru the datawindow and
change the first
and last row of the group/level:
long ll_cnt, ll_max, ll_group
string ls_first, ls_last
ll_max = dw_1.rowcount()
for ll_cnt = 1 to ll_max
ls_first = dw_1.Describe("evaluate('first( getrow() for
group 1 )',"+string(ll_cnt)+")")
ls_last = dw_1.Describe("evaluate('last( getrow() for group
1 )',"+string(ll_cnt)+")")
//clear out old values
dw_1.setitem(ll_cnt, 'dummyvalue', "")
if ll_cnt = long(ls_first) then
ll_group = ll_group + 1
dw_1.setitem(ll_cnt, 'dummyvalue', 'h:'+string( ll_group))
end if
if ll_cnt = long(ls_last) then
dw_1.setitem(ll_cnt, 'dummyvalue', 't:'+string( ll_group))
end if
next