以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何在选定列标题后求和  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=41081)

--  作者:zhangchi96
--  发布时间:2013/10/10 21:19:00
--  如何在选定列标题后求和
  姓名  部门 工资 奖金
   甲    A 12      43 
   乙    B   13     53
   丙    A   14     63

请教,在窗体中插入了上面的表格,

1、在鼠标点击列标题“工资”,自动对“部门”为A、B及整个部门分别求和,

 

并用控件“求和”显示内容为:A部门工资求和26.00,B部门工资求和13.00,全部工资求和39.00

 

若鼠标点击的列标题为“奖金”则控件就显示为:A部门奖金求和106.00,B部门奖金求和53.00,全部奖金159.00

 

2、在鼠标点击列标题 “部门”时,则对部门进行升序排序,再点击时降序排列

 

恳请各位高手指教,敬请狐爸指导。

 


--  作者:有点甜
--  发布时间:2013/10/10 21:37:00
--  
 可以做到,你先做好表格,做好窗口控件,然后上传上来。
[此贴子已经被作者于2013-10-10 21:37:24编辑过]

--  作者:zhangchi96
--  发布时间:2013/10/10 22:36:00
--  

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:统计问题.table

文件已经上传,烦请“有点甜”抽空不吝指教,谢谢!辛苦了。


--  作者:有点甜
--  发布时间:2013/10/10 23:27:00
--  
 不容易,总算做好了。

 
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:模拟点击标题.table


--  作者:lsy
--  发布时间:2013/10/11 6:57:00
--  

顶有点甜

也顶楼主


--  作者:zhangchi96
--  发布时间:2013/10/11 7:48:00
--  

特别感谢“有点甜”,确实让我过意不去了,我以为你在第二天再做的,意想不到你连夜做好了,用了你休息的时间,再此深切感谢,谢谢“有点甜”!!!

 

我先看一下,有问题再向你请教


--  作者:zhangchi96
--  发布时间:2013/10/13 21:59:00
--  
我把“有点甜”的代码引用到自编的程序里,效果很好,但代码t = e.Form.Controls("Table1").Table  中的表Table1 如果是页面集合中的第1页 ,运行时就会出错,出错信息如下,请“有点甜”指导一下,是不是我哪里引用不当了?

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.


************** Exception Text **************

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

   at System.Collections.ArrayList.get_Item(Int32 index)

   at C1.Win.C1FlexGrid.ColumnCollection.get_Item(Int32 index)

   at Foxtable.ColCollection.get_Item(Int32 int_0)

   at UserCode.MouseEnterCell(Object sender, RowColEventArgs e)

   at C1.Win.C1FlexGrid.RowColEventHandler.Invoke(Object sender, RowColEventArgs e)

   at C1.Win.C1FlexGrid.C1FlexGridBase.OnMouseEnterCell(RowColEventArgs e)

   at C1.Win.C1FlexGrid.C1FlexGridBase.?


(Point value)

   at ??


.??
.?
(MouseEventArgs e)

   at C1.Win.C1FlexGrid.C1FlexGridBase.OnMouseMove(MouseEventArgs e)

   at System.Windows.Forms.Control.WmMouseMove(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


--  作者:zhangchi96
--  发布时间:2013/10/20 12:14:00
--  

还是没有解决。。。。。图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2013/10/20 20:51:00
--  
 做个出错的例子上来瞧瞧,因为不知道你是怎么改的。应该是些小问题。