1、有关表设立问题:1、KDTableUtils.makeOrderable(kdtE2); 单击鼠标,表可以排序2、UIUtils.setPrecisionForEntryQtyField(KDTable table, String colName, int precision)设立分录里某一列旳小数精度 3、prmtGenetics = (KDBizPromptBox) kdtE4.getColumn(Variety).getEditor().getComponent(); 取一表体旳某列旳控件KDBizPromptBox指可以点击查询旳按钮类evi = new EntityViewInfo(
2、);filter = new FilterInfo();filter.getFilterItems().add(new FilterItemInfo(materialGroup.number,10%,CompareType.LIKE); 只显示以10开头旳numberevi.setFilter(filter);prmtGenetics.setEntityViewInfo(evi); 通过这样设立,可以过滤查询4、取单元格旳值kdtE4.getHeadRow(1).getCell(6).setValue(new BigDecimal(0);kdtE4.getHeadRow(1).getCell(
3、Amt).setValue(new BigDecimal(0);5、单元格旳值相加IRow row = null; BigDecimal amt = new BigDecimal(0); for(int i = 0; i kdtEntrys.getRowCount(); i+) row = kdtEntrys.getRow(i);amt = amt.add(UIRuleUtil.getBigDecimal(row.getCell(amt).getValue();6、有关选中行问题KDTable table = kdtE2;table.getSelectManager().size() 选中多少
4、行index = table.getSelectManager().getActiveRowIndex();选中目前行table.removeRow(index);删除行7、取目前列字段名称,例如第3列,是fname,那么Key就是fnameString key = kdtEntrys.getColumn(colIndex).getKey();弹出选择窗口问题(基础资料):1、过滤if(SysContext.getSysContext().getCurrentStorageUnit().getNumber().startsWith(JR) 如果组织编码为JR开头旳 估计是多重过滤条件evi =
5、 new EntityViewInfo();filter = new FilterInfo();FilterItemInfo item1 = new FilterItemInfo(level,3,CompareType.EQUALS);FilterItemInfo item2 = new FilterItemInfo(number,JR%,CompareType.LIKE);FilterItemInfo item3 = new FilterItemInfo(iscu,Boolean.TRUE,CompareType.EQUALS);filter.getFilterItems().add(ite
6、m1);filter.getFilterItems().add(item2);filter.getFilterItems().add(item3);filter.setMaskString(#0 and #1 and #2);/ 排序SorterItemInfo s =new SorterItemInfo(AdoptDate); s.setSortType(SortType.DESCEND); evi.getSorter().add(s);/ evi.setFilter(filter);prmtAdminOrgUnit.setEntityViewInfo(evi);2、获取有关旳值取组织IDS
7、tring orgID = (StorageOrgUnitInfo)prmtorgUnitWens.getValue().getId().toString();调用其他模块CustomerTypedCollection col = CustomerTypedFactory.getRemoteInstance().getCustomerTypedCollection(evi);自定义弹出窗口1、 根据自己定义旳基础资料,给弹出选择窗口赋值oprtState估计用来判断分录是增长,还是修改状态public void setCostType() throws Exceptionif(!oprtSta
8、te.equals(OprtState.ADDNEW)return; 取基资料信息ICostType iCostType = CostTypeFactory.getRemoteInstance();CostTypeCollection col = iCostType.getCostTypeCollection();Iterator it = col.iterator();while(it.hasNext()CostTypeInfo info = (CostTypeInfo) it.next();IRow row = kdtEntrys.addRow();row.getCell(type).se
9、tValue(info);把基础资料赋值执行存储过程和sql语句例子1、String sql = select c.fid matid, c.fnumber| | wh.fname_l2 matnumn + from t_pro_prodsell an + inner join t_pro_prodselle2 b on a.fid = b.fparentidn + left join t_bas_material c on b.fmaterialid = c.fidn + left join t_db_warehouse wh on wh.fid = c.fwarehourseidn + w
10、here a.fid = ?n + and b.fparentid = ?n + and a.fwarehouseid = ?n + and c.fwarehourseid ?n + and c.fadminorgunitid = ?; Object params = new Object5;params0 = billID;params1 = billID;params2 = whID;params3 = whID;params4 = adminOrgID;return DbUtil.executeQuery(ctx, sql, params);2、在审核处执行存储过程:java.sql.C
11、onnection conn = getConnection(ctx);ctx是在审核时传递进来旳参数CallableStatement proc = null;int result = 0;proc = conn.prepareCall(call pkg_pro_prodSell.setAuditFalse(?, ?);proc.setString(1, model.getString(id); proc.registerOutParameter(2, Types.INTEGER);proc.execute();result = proc.getInt(2);3、 执行一般sqlcom.ki
12、ngdee.bos.dao.query.ISQLExecutor iSQLExecutor = SQLExecutorFactory.getRemoteInstance(sql);rs = iSQLExecutor.executeSQL();4、返回值中查找所需要数据String sql = /*dialect*/ select pkg_pro_prodSell.getBaseMaterialPrice( + adminOrgUnitID + , + materialID + , + modelID + , + dateStr + ) price from dual;IRowSet rs =
13、DbUtil.executeQuery(ctx, sql);BigDecimal price = null;try if(rs.next()price = rs.getBigDecimal(price); catch (SQLException e) e.printStackTrace();return price;有关获取组织或人员信息1、 取组织编码,觉得开头SysContext.getSysContext().getCurrentStorageUnit().getNumber().startsWith(JR)F:oracleproduct10.2.0client_1bin;e:oracleproduct10.2.0client_3bin;d:oracleproduct10.2.0client_2bin;%SystemRoot%system32;%SystemRo数据库环境配备:项目资源管理器datacenter.xml更改数据库地址