以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 交叉统计表可以绘制单元格按钮吗? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=104793) |
-- 作者:liufucan -- 发布时间:2017/8/5 9:05:00 -- 交叉统计表可以绘制单元格按钮吗? 在全局表事件的cellbuttonclick中这样写代码无效。 ![]() ![]() If e.Table.Name = "A1销控" Then If e.Col.IsNumeric AndAlso e.Col.Name <> "楼层" Then If e.Row.IsNull(e.Col.Name) = False \'且该列已经输入内容 e.Cancel = True \'取消默认动作 Forms("窗口1").Open() End If End If End If |
-- 作者:有点蓝 -- 发布时间:2017/8/5 9:15:00 -- 没有开启事件:http://www.foxtable.com/webhelp/scr/0671.htm 上传统计表后 DataTables("统计表").GlobalHandler.CellButtonClick = True
|
-- 作者:liufucan -- 发布时间:2017/8/5 10:06:00 -- 已经给统计表指定了窗口了还是不能生效,是否跟我开启了drawcell事件有关? DataTables("统计表").GlobalHandler.drawcell = True
|
-- 作者:有点蓝 -- 发布时间:2017/8/5 10:08:00 -- 要开启CellButtonClick 啊,看2楼 |
-- 作者:有点蓝 -- 发布时间:2017/8/5 10:10:00 -- 窗口表 e.form.controls("Table1").Table.Datatable.GlobalHandler.CellButtonClick = True
|
-- 作者:liufucan -- 发布时间:2017/8/5 10:26:00 -- DataTables("A1销控 ![]() ![]() ").GlobalHandler.drawcell = True 和 DataTables("A1销控").GlobalHandler.CellButtonClick = True 都加了,drawcell事件生效了,CellButtonClick事件不生效 代码如下: If e.Table.Name = "A1销控" Then If e.Col.IsNumeric AndAlso e.Col.Name <> "楼层" Then If e.Row.IsNull(e.Col.Name) = False \'且该列已经输入内容 e.form.controls("A1销控").Table.Datatable.GlobalHandler.CellButtonClick = True e.Cancel = True \'取消默认动作 Forms("窗口1").Open() End If End If End If |
-- 作者:有点蓝 -- 发布时间:2017/8/5 10:31:00 -- GlobalHandler加到统计表生成之后,不是加给这个代码里。不会上传例子 |
-- 作者:liufucan -- 发布时间:2017/8/5 10:39:00 -- 就是加在统计表生成之后的啊,PrepareEdit事件和DrawCell事件都可以生效,就是CellButtonClick不行 AfterOpenProject代码: Dim g1 As New CrossTableBuilder("A1销控", DataTables("总表"), "[楼号]=\'A1\'") g1.HGroups.AddDef("楼层") g1.VGroups.AddDef("楼号") g1.VGroups.AddDef("单元") g1.VGroups.AddDef("位置") g1.Totals.AddDef("房间状态", AggregateEnum.Max, "房间状态") g1.Filter = "[楼号]=\'A1\'" g1.Build() DataTables("A1销控").GlobalHandler.PrepareEdit = True DataTables("A1销控").GlobalHandler.CellButtonClick = True DataTables("A1销控").GlobalHandler.DrawCell = True |
-- 作者:有点蓝 -- 发布时间:2017/8/5 10:57:00 -- Dim g1 As New CrossTableBuilder("A1销控", DataTables("总表"), "[楼号]=\'A1\'") g1.HGroups.AddDef("楼层") g1.VGroups.AddDef("楼号") g1.VGroups.AddDef("单元") g1.VGroups.AddDef("位置") g1.Totals.AddDef("房间状态", AggregateEnum.Max, "房间状态") g1.Filter = "[楼号]=\'A1\'" g1.Build() Tables("A1销控").Cols("楼层").ComboList = "|..." DataTables("A1销控").GlobalHandler.PrepareEdit = True DataTables("A1销控").GlobalHandler.CellButtonClick = True DataTables("A1销控").GlobalHandler.DrawCell = True |
-- 作者:liufucan -- 发布时间:2017/8/5 11:34:00 -- 这样点击楼层是可以了,但是如何实现点击哪一套就可以弹出哪一套的信息呢? |