回复 1楼swejet的帖子
spread 目前不支持自动更新列脚合计自动计算,可以通过AutoFilteredColumn事件来自定义实现:
关键代码:
- protected void FpSpread1_AutoFilteredColumn(object sender, FarPoint.Web.Spread.AutoFilteredColumnEventArgs e)
- {
- int []array = this.FpSpread1.ActiveSheetView.RowFilter.GetIntersectedFilteredInRows();
- int total = 0;
- for (int i = 0; i < array.Length; i++)
- {
- total += (int)(this.FpSpread1.ActiveSheetView.Cells[i,3].Value);
- }
- this.FpSpread1.ActiveSheetView.ColumnFooter.Cells[0, 3].Value = total;
- }
复制代码
附件是实现demo(vs2013+Spread 8.0):
16706.zip
(3.65 MB, 下载次数: 249)
|