Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
项目事件 MainTableChangde事件中写入如下代码后,请老师看看问题出在哪儿,请老师赐教
‘1设置折叠模式和内联筛选树标准代码
Dim st As New InlineTreeSetting()
st.ParentCol = "科目编码"
st.ChildCol = "项目构成"
st.TreeCol = "项目构成"
下载信息 [文件大小: 下载次数: ] 点击浏览该文件:关于目录树的应用.zip
st.TextCol = "项目构成"
st.ValueCol = "合价"
st.Unique = False
st.SortCol = "sysgrdtreesort"
st.AggregateCols = {"合价", "数据调整3" }
st.UseStyle = True
st.Subtotal = True
st.MergeTotal = True
st.IncludeSub = False
st.GridTree = True
st.ExpandTo = -1
‘2设置在不同主表中启用折叠模式和内联筛选树树代码
Dim bms() As String = {"隐框幕墙单价分析表", "明框幕墙单价分析表"}
For Each bm As String In bms
Tables(bm).ShowGridTree(st)
Tables(bm).OpenInlineFilterTree(st)
Tables(bm).OpenInlineTree()
‘3 设置三种不同目录树代码
‘目录树1 代码
Dim tb1 As New DropTreeBuilder
tb1.SourceTable = DataTables("材料价格系统")
'指定目录树表
tb1.TreeSort="材料排序"
tb1.TreeCols = "材料类别|材料类别2|备注" '指定用于生成目录树的列
tb1.SourceCols = "材料类别|材料类别2|材料名称|单位|单价|备注" '指定数据来源列
tb1.ReceiveCols = "辅助列1|辅助列2|项目构成|单位|单价|备注" '指定数据接收列
tb1.TreeWidth = 200
tb1.TreeHeight =1000
‘目录树2 代码
Dim tb2 As New DropTreeBuilder
tb2.SourceTable = DataTables("人工费系统")
'指定目录树表
tb2.TreeCols = "幕墙形式|幕墙类别|人工费" '指定用于生成目录树的列
tb2.SourceCols = "幕墙形式|幕墙类别|人工费|单位|单价" '指定数据来源列
tb2.ReceiveCols = "辅助列1|辅助列2|项目构成|单位|单价" '指定数据接收列
‘目录树2 代码
Dim tb3 As New DropTreeBuilder
tb3.SourceTable = DataTables("比率") '指定目录树表
tb3.TreeCols = "类别|名称" '指定用于生成目录树的列
tb3.SourceCols = "名称|类别|比率系数" '指定数据来源列
tb3.ReceiveCols = "项目构成|辅助列1|比率系数"'指定数据接收列
‘4
切换到主表后,根据科目编码列的文本内容调用不同的目录树代码
If MainTable.Name = bm Then
Dim zfc As String = Tables(bm).Current("科目编码")
If zfc = "材料费" Then ‘目录树1 科目编码为 材料费 的区域 见上面表格
Tables(bm).Cols("项目构成").DropTree =
tb1.Build()
Else If zfc = "人工费" Then ‘目录树2 科目编码为 人工费 的区域 见上面表格
Tables(bm).Cols("项目构成").DropTree =
tb2.Build()
Else If zfc = "机械费" Or zfc = "间接费" Or zfc = "利润" Or zfc =
"税金" Then
‘目录树3 见上面表格
Tables(bm).Cols("项目构成").DropTree =
tb3.Build()
End If
End If
Next
那些生成折叠模式和内联筛选树的代码如下代码还是写在MainTableChangde事件中
Dim st As New InlineTreeSetting()
st.ParentCol = "科目编码"
st.ChildCol = "项目构成"
st.TreeCol = "项目构成"
st.TextCol = "项目构成"
st.ValueCol = "合价"
st.Unique = False
st.SortCol = "sysgrdtreesort"
st.AggregateCols = {"合价", "数据调整3" }
st.UseStyle = True
st.Subtotal = True
st.MergeTotal = True
st.IncludeSub = False
st.GridTree = True
st.ExpandTo = -1
‘2设置在不同主表中启用折叠模式和内联筛选树树代码
Dim bms() As String = {"隐框幕墙单价分析表", "明框幕墙单价分析表"}
For Each bm As String In bms
Tables(bm).ShowGridTree(st)
Tables(bm).OpenInlineFilterTree(st)
Tables(bm).OpenInlineTree()
Next
把下面的目录树生成和调用的代码写在表事件BeforeSelchang事件中
Dim
tb1 As New DropTreeBuilder
tb1.SourceTable = DataTables("材料价格系统") '指定目录树表
tb1.TreeSort = "材料排序"
tb1.TreeCols = "材料类别|材料类别2|备注" '指定用于生成目录树的列
tb1.SourceCols = "材料类别|材料类别2|材料名称|单位|单价|备注" '指定数据来源列
tb1.ReceiveCols = "辅助列1|辅助列2|项目构成|单位|单价|备注" '指定数据接收列
Dim
tb2 As New DropTreeBuilder
tb2.SourceTable = DataTables("人工费系统") '指定目录树表
tb2.TreeCols = "幕墙形式|幕墙类别|人工费" '指定用于生成目录树的列
tb2.SourceCols = "幕墙形式|幕墙类别|人工费|单位|单价" '指定数据来源列
tb2.ReceiveCols = "辅助列1|辅助列2|项目构成|单位|单价" '指定数据接收列
Dim
tb3 As New DropTreeBuilder
tb3.SourceTable = DataTables("比率") '指定目录树表
tb3.TreeCols = "类别|名称" '指定用于生成目录树的列
tb3.SourceCols = "名称|类别|比率系数" '指定数据来源列
tb3.ReceiveCols = "项目构成|辅助列1|比率系数"'指定数据接收列
Dim zfc As String = Tables("隐框幕墙单价分析表").Current("科目编码")
If zfc = "材料费" Then
Tables("隐框幕墙单价分析表").Cols("项目构成").DropTree = tb1.Build()
Else If zfc = "人工费" Then
Tables("隐框幕墙单价分析表").Cols("项目构成").DropTree = tb2.Build()
Else If zfc = "机械费" Or zfc = "间接费" Or zfc = "利润" Or zfc = "税金" Then
Tables("隐框幕墙单价分析表").Cols("项目构成").DropTree = tb3.Build()
End If