EAS多分录套打设置

多分录的单据在做套打时,一般都有好几个Query,可通过下面方法做相应设置: 


Java代码   收藏代码
  1. public void actionPrint_actionPerformed(ActionEvent e) throws Exception {  
  2.   
  3.     // super.actionPrint_actionPerformed(e);  
  4.     if (editData.getId() != null) {  
  5.         String id = editData.getId().toString();  
  6.         DataProvider data = new DataProvider(id);  
  7.         KDNoteHelper appHlp = new KDNoteHelper();  
  8.         appHlp.print("bim/custom/classmanage/reportclass/Reportdaxiaoban",  
  9.                 data, javax.swing.SwingUtilities.getWindowAncestor(this));  
  10.     } else {  
  11.         MsgBox.showWarning("请先保存单据,再点打印!");  
  12.     }  



Java代码   收藏代码
  1. public class DataProvider implements BOSQueryDelegate {  
  2.   
  3.     private static final Logger logger = CoreUIObject  
  4.             .getLogger(AbstractFrozenDaxiaobanEditUI.class);  
  5.     private String billId;  
  6.   
  7.     public DataProvider(String billId) {  
  8.         this.billId = billId;  
  9.     }  
  10.   
  11.     public IRowSet execute(BOSQueryDataSource ds) {  
  12.         //  
  13.         IRowSet rs = null;  
  14.         //  
  15.         try {  
  16.             IQueryExecutor iqec = null;  
  17.             FilterInfo filterInfo = new FilterInfo();  
  18.             EntityViewInfo viewInfo = new EntityViewInfo();  
  19.             if (ds.getID().equals("BillQuery")) {  
  20.                 iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
  21.                         "com.kingdee.eas.custom.test.app",  
  22.                         "BillQuery"));  
  23.                 filterInfo.getFilterItems().add(  
  24.                         new FilterItemInfo("id"this.billId,  
  25.                                 CompareType.EQUALS));  
  26.                 viewInfo.setFilter(filterInfo);  
  27.                 iqec.setObjectView(viewInfo);  
  28.                 iqec.option().isAutoTranslateBoolean = true;  
  29.                 iqec.option().isAutoTranslateEnum = true;  
  30.                 //  
  31.                 rs = iqec.executeQuery();  
  32.             }else if (ds.getID().equals("Entry2Query")) {  
  33.                 iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
  34.                         "com.kingdee.eas.custom.test.app",  
  35.                         "Entry2Query"));  
  36.                 filterInfo.getFilterItems().add(  
  37.                         new FilterItemInfo("parentid"this.billId,  
  38.                                 CompareType.EQUALS));  
  39.                 viewInfo.setFilter(filterInfo);  
  40.                 iqec.setObjectView(viewInfo);  
  41.                 iqec.option().isAutoTranslateBoolean = true;  
  42.                 iqec.option().isAutoTranslateEnum = true;  
  43.                 //  
  44.                 rs = iqec.executeQuery();  
  45.             } else if (ds.getID().equals("EntryQuery")) {  
  46.                 iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
  47.                         "com.kingdee.eas.custom.test.app",  
  48.                         "EntryQuery"));  
  49.                 filterInfo.getFilterItems().add(  
  50.                         new FilterItemInfo("parentid"this.billId,  
  51.                                 CompareType.EQUALS));  
  52.                 viewInfo.setFilter(filterInfo);  
  53.                 iqec.setObjectView(viewInfo);  
  54.                 iqec.option().isAutoTranslateBoolean = true;  
  55.                 iqec.option().isAutoTranslateEnum = true;  
  56.                 //  
  57.                 rs = iqec.executeQuery();  
  58.             } else {  
  59.                 logger.info("==============其他执行,ds.getID()====" + ds.getID());  
  60.             }  
  61.   
  62.         } catch (Exception ex) {  
  63.             ex.printStackTrace();  
  64.         }  
  65.         int rowcount = rs.size();  
  66.         logger.info("rs.size====" + rowcount);  
  67.         return rs;  
  68.     }  
  69.   
  70. }  


注:parentid是新建Query中的字段名称,可做相应的修改。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值