我想用Group方法分组,但是分组统计的总计显示总是为0,具体代码如下:
sheetView.AllowGroup = true;
GroupDataModel gdm = new GroupDataModel(sheetView.Models.Data);
sheetView.Models.Data = gdm;
SortInfo[] siList = new SortInfo[] { new SortInfo(0,true) };
gdm.Group(siList, null);
DefaultGroupFooter dgf = sheetView.DefaultGroupFooter[0];
ISheetDataModel dataModel = dgf.DataModel;
(dataModel as IAggregationSupport).SetCellAggregationType(0, 2, AggregationType.Count);
(dataModel as IAggregationSupport).SetCellAggregationFormat(0, 2, "总计:{0}");
sheetView.GroupFooterVisible = true;
代码和实例代码一样的,为什么我的不能统计出来 |
|