EAS Bos 合计行代码
来源:互联网 发布:淘宝拍照用哪款相机好 编辑:程序博客网 时间:2024/05/22 09:03
/** * 功能:添加合计行 * * @param table * 指定的KDTable * @param fields * 需要合计的列 */ public static void apendFootRow(KDTable table, String fields[]) { int size = fields.length; if (size == 0) return; Map sumValue = new HashMap(); // 利用getRowCount的到的行可能不正确 int count = table.getRowCount3(); for (int i = 0; i < fields.length; i++) { sumValue.put(fields[i], new BigDecimal("0.00")); } IRow footRow = null; KDTFootManager footManager = table.getFootManager(); if (footManager == null) { footManager = new KDTFootManager(table); footManager.addFootView(); table.setFootManager(footManager); } // 计算所有指定行的合计值 footRow = footManager.getFootRow(0); for (int i = 0; i < count; i++) { IRow row = table.getRow(i); for (int j = 0; j < fields.length; j++) { sumValueForCell(row, fields[j], sumValue); } } if (footRow == null) { footRow = footManager.addFootRow(0); } // 设置合计行显示样式 String colFormat = "%{0.00}f"; String total = EASResource.getString(FrameWorkClientUtils.strResource + "Msg_Total"); table.getIndexColumn().setWidthAdjustMode(KDTIndexColumn.WIDTH_MANUAL); table.getIndexColumn().setWidth(30); footManager.addIndexText(0, total); footRow.getStyleAttributes().setBackground(new Color(0xf6, 0xf6, 0xbf)); for (int i = 0; i < size; i++) { String colName = fields[i]; footRow.getCell(colName).getStyleAttributes().setNumberFormat( colFormat); footRow.getCell(colName).getStyleAttributes().setHorizontalAlign( HorizontalAlignment.RIGHT); footRow.getCell(colName).getStyleAttributes().setFontColor( Color.black); } // 设置合计行的值 for (int i = 0; i < fields.length; i++) { footRow.getCell(fields[i]).setValue(sumValue.get(fields[i])); } } private static void sumValueForCell(IRow row, String key, Map sumValue) { ICell cell = row.getCell(key); if (cell != null) { Object obj = cell.getValue(); if (obj != null) { BigDecimal keyValue = (BigDecimal) sumValue.get(key); keyValue = keyValue.add(new BigDecimal(obj.toString())); sumValue.put(key, keyValue); } } }
- EAS Bos 合计行代码
- EAS Bos 合计行代码
- EAS Bos 合计行代码
- EAS BOS 报表添加合计行,和每行合计
- EAS Bos 合计行代码(主要针对报表类的table)
- EAS BOS 常用代码
- eas bos 常用代码
- EAS BOS 绑定QUERY的列表界面,代码添加合计脚
- EAS BOS 绑定QUERY的列表界面,代码添加合计脚
- EAS BOS 绑定QUERY的列表界面,代码添加合计脚
- 金蝶EAS,BOS,KDTable表格增加普通行、合计行,需先解析表格
- eas bos 客户端常用代码
- EAS BOS代码添加F7Query
- EAS BOS 列表定位的代码
- eas bos常用代码-新增单据,参数传递
- eas bos常用代码-新增单据,参数传递
- EAS BOS代码对query中字段进行排序
- EAS BOS 单据列表界面排序的代码实现
- Android客户端优化
- Spring Autowire自动装配
- 矩阵范数/谱/条件数
- document.domain 跨域问题
- 杨氏矩阵
- EAS Bos 合计行代码
- 合并子线程
- 使用递归算法将批量调用异步处理转化为同步调用,并使用Java模拟ExtJs异步处理同步化
- EASBos 对于某个权限的验证
- 点击按钮,在电脑右下端弹出提示框,鼠标不离开,提示框不消失。
- 常用的正则表达式
- MyEclipse6.5安装SVN插件的三种方法
- jd-gui反编译 access$xxx类函数说明
- Apache 中使用的 APR Memory Pool 分析