• 如何指定是否要进行数据分组以及对哪些列进行分组
// 指定KDTable要进行数据分组
table.getGroupManager().setGroup(true);
// 指明要对0、1、2三列进行分组
table.getColumn(0).setGroup(true);
table.getColumn(1).setGroup(true);
table.getColumn(2).setGroup(true);
  • 如何指定是否根据分组进行单元融合
// 指明要对0、1、2列的分组进行单元融合
table.getColumn(0).setMergeable(true);
table.getColumn(1).setMergeable(true);
table.getColumn(2).setMergeable(true);
  • 如何指定是否要做统计,对哪些分组进行统计,以及是否做总计
// 指明分组后要做总计
table.getGroupManager().setTotalize(true);
// 指明要对第0列进行统计
table.getColumn(0).setStat(true);
// 指明要对第1列进行统计
table.getColumn(1).setStat(true);
// 指明要对第2列进行统计
table.getColumn(2).setStat(true);
  • 如何指定统计行的位置
// 统计行的位置处于数据行的下方
table.getGroupManager().setOrientation(KDTStyleConstants.DOWN);
// 统计行的位置处于数据行的上方
table.getGroupManager().setOrientation(KDTStyleConstants.UP);
  • 如何定义统计行显示的内容和样式
// 定义两个变量
IRow row0;
KDTDataStyle ds;
// 设置统计行模板
// 获取总计行的模板(总计行的分组级别为-1)
row0 = (IRow)table.getGroupManager().getStatRowTemplate(-1);
// 修改总计行的背景色为蓝色
row0.getStyleAttributes().getInterior().setBackground(Color.blue);
// 设置总计行第0个单元的值
row0.getCell(0).setValue("总计");
// 设置总计行第3个单元的统计公式
row0.getCell(3). setExpressions(KDTGroupManager.STAT_SUM);
        
// 获取第0级统计的模板
row0 = (IRow)table.getGroupManager().getStatRowTemplate(0);
// 设置第0级统计行的背景色
row0.getStyleAttributes().getInterior().setBackground(Color.green);
// 设置第0级统计行的第0个单元的值
row0.getCell(0).setValue("平均值");
// 设置第0级统计行第3个单元的统计公式
row0.getCell(3).setExpressions(KDTGroupManager.STAT_AVERAGE);
        
// 获取第1级统计的模板
row0 = (IRow)table.getGroupManager().getStatRowTemplate(1);
// 设置第1级统计行的背景色
row0.getStyleAttributes().getInterior().setBackground(Color.cyan);
// 设置第1级统计行的第0个单元的值
row0.getCell(1).setValue("最大值");
// 设置第1级统计行第3个单元的统计公式
row0.getCell(3).setExpressions(KDTGroupManager.STAT_MAX);
// 获取第2级统计的模板
row0 = (IRow)table.getGroupManager().getStatRowTemplate(2);
// 设置第2级统计行的背景色
row0.getStyleAttributes().getInterior().setBackground(Color.darkGray);
// 设置第2级统计行的第0个单元的值
row0.getCell(2).setValue("最小值");
// 设置第2级统计行第3个单元的统计公式
row0.getCell(3).setExpressions(KDTGroupManager.STAT_MIN);
  • 如何根据分组统计的情况生成树
// 生成树
table.getGroupManager().toTreeColumn();
// 重新调整布局并刷新
table.reLayoutAndPaint();

eas之kdtable分组的更多相关文章

  1. eas之kdtable格式化

    设置表.列.行或单元的格式化字符串 // 设置表table.getStyleAttributes().setNumberFormat(formatString); // 设置列column.getSt ...

  2. eas之控制kdtable滚动条

    //滚动条支持三种状态 自动 隐藏 显示 public static final int SCROLL_STATE_AUTO=0://自动根据数据判断是否显示或隐藏 public static fin ...

  3. eas之获得任何一个KDTable的选中行

    import com.kingdee.bos.ctrl.kdf.table.util.KDTableUtil; int[] selectRows =KDTableUtil.getSelectedRow ...

  4. EAS常用工具类

    package com.kingdee.eas.custom; import java.io.File; import java.io.FileNotFoundException; import ja ...

  5. eas之指定虚模式

    KDTable支持三种取数模式:实模式.虚模式分页.虚模式分组,默认为实模式.// 实模式table.getDataRequestManager().setDataRequestMode(KDTDat ...

  6. 一条Sql语句分组排序并且限制显示的数据条数

    如果我想得到这样一个结果集:分组排序,并且每组限定记录集的数量,用一条SQL语句能办到吗? 比如说,我想找出学生期末考试中,每科的前3名,并按成绩排序,只用一条SQL语句,该怎么写? 表[TScore ...

  7. xamarin android ListView手动分组

    xamarin的listview控件其实自带有分组方法,关于xamarin listview的自带分组方法请自行参考官方文档,我这里只写自己写的分组方法.xamarin自带的分组好是好,功能多,但是加 ...

  8. [Java Collection]List分组之简单应用.

    前言 今天有一个新需求, 是对一个List进行分组, 于是便百度到一些可用的代码以及我们项目使用的一些tools, 在这里总结下方便以后查阅. 一: 需求 现在我们一个数据库表t_series_val ...

  9. TSQL 分组集(Grouping Sets)

    分组集(Grouping Sets)是多个分组的并集,用于在一个查询中,按照不同的分组列对集合进行聚合运算,等价于对单个分组使用“union all”,计算多个结果集的并集.使用分组集的聚合查询,返回 ...

随机推荐

  1. sql简单优化点滴

    select uppagent.agent_no AGENT_NO, ISNULL(countsubagent,0) REFERRAL_AGENT_NUM, ISNULL(countsubcustom ...

  2. Intellij Idea 13:导入openfire源代码

    网络上已经有篇关于openfire导入到Intellij Idea的文章(http://www.th7.cn/Program/java/201404/187018.shtml),不过在我导入的过程中, ...

  3. [RxJS 6] The Catch and Rethrow RxJs Error Handling Strategy and the finalize Operator

    Sometime we want to set a default or fallback value when network request failed. http$ .pipe( map(re ...

  4. android 随手记之文件+參数上传请求

    第一步:须要两个jar的支持,稍后以下给会出下载地址. 第二步:建立一个project 以下贴出最基本的代码 package com.example.testpaizhao; import java. ...

  5. Codeforces 510 A.Fox and Snake

    题目链接:http://codeforces.com/contest/510/problem/A A. Fox And Snake time limit per test2 seconds memor ...

  6. [odroid-pc] ubuntu12.04 android4.0移植到odroid-pc过程

    參考:http://blog.csdn.net/sunnybeike/article/details/8098349 odroid  prebuilt版 img下载地址:tag=ODROID-PC&q ...

  7. mac下安装tensorflow及入门例子

    https://www.tensorflow.org/install/install_mac 使用virtualenv安装,virtualenv相当于使tensorflow运行在虚拟机环境下. 需要使 ...

  8. Android内存解析(一)—从Linux系统内存逐步认识Android应用内存

    总述 Android应用程序被限制了内存使用上限,一般为16M或24M(具体看系统设置),当应用的使用内存超过这个上限时,就会被系统认为内存泄漏,被kill掉.所以在android开发时,管理好内存的 ...

  9. UILabel垂直方向显示(上下的顺序显示)。

    NSString* text = @"一"; NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFont ...

  10. UIView动画基础

    1 Position 平移 [UIView animateWithDuration:1.0 animations:^{ _blueView.centerX = self.view.width -100 ...