在EASbos中配置套打的高级设置

	public class MyDataProvider extends AbstractPrintDataProvider{

		
		@Override
		public IRowSet getData(R1PrintDataSource dataSource) throws Exception {
			IRowSet irow = null;
			String curBillID = editData.getId().toString();
			IQueryExecutor iqec = null;  
	        FilterInfo filterInfo = new FilterInfo();  
	        EntityViewInfo viewInfo = new EntityViewInfo(); 
			if("PurchaseRequestBillQuery.bos-query".equals(dataSource.getId())){
				iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
	                    "com.kingdee.eas.custom.office.purchase.app",  
	                    "PurchaseRequestBillQuery"));  
	            filterInfo.getFilterItems().add(  
	                    new FilterItemInfo("id", curBillID,  
	                            CompareType.EQUALS));  
	            viewInfo.setFilter(filterInfo);  
	            iqec.setObjectView(viewInfo);  
	            iqec.option().isAutoTranslateBoolean = true;  
	            iqec.option().isAutoTranslateEnum = true;  
	                        
				try {
					irow = iqec.executeQuery();
				} catch (BOSException e) {
					MsgBox.showInfo("获取套打数据有误:"+e.getMessage());
				}
				
				
			} 
			if("PurchaseRequestAppove".equals(dataSource.getId())){

				StringBuffer sql = new StringBuffer();
				sql.append("SELECT "); 
				sql.append("A.FID AS billID2,")
					.append("A.FCreateTime as auditDate,")
					.append("A.FIsPass  as auditResult,")
					.append("B.FName_l2 as auditPerson,")
					.append("A.FOpinion_l2 as auditAdvise");
				sql.append(" FROM T_BAS_MultiApprove A")
					.append(" INNER JOIN T_PM_User   B ON A.FCreatorID = B.FID")
					.append(" INNER JOIN T_BD_Person   C ON B.FPersonId = C.FID");
				
				sql.append(" where A.FBillID='").append(curBillID).append("' order by A.FCreateTime");
				
				
				ISQLExecutor isexe = SQLExecutorFactory.getRemoteInstance(sql.toString());
				try {
					irow = isexe.executeSQL();
					return irow;
				} catch (BOSException e) {
					MsgBox.showInfo("获取套打数据有误:"+e.getMessage());
				}
			} 
			if("PurchaseRequestBillR1Query".equals(dataSource.getId())){
				iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
	                    "com.kingdee.eas.custom.office.purchase.app",  
	                    "PurchaseRequestBillR1Query"));  
	            filterInfo.getFilterItems().add(  
	                    new FilterItemInfo("id", curBillID,  
	                            CompareType.EQUALS));  
	            viewInfo.setFilter(filterInfo);  
	            iqec.setObjectView(viewInfo);  
	            iqec.option().isAutoTranslateBoolean = true;  
	            iqec.option().isAutoTranslateEnum = true;  
	                        
				try {
					irow = iqec.executeQuery();
				} catch (BOSException e) {
					MsgBox.showInfo("获取套打数据有误:"+e.getMessage());
				}
			} 
			return irow;
		
		}
		
	}

需要有一点主意的就是,在自己写sql语句查询的时候,需要在套打管理那里选中——右击新建一个自定义的元数据query。对于枚举类型需要自己在单元格加上后置脚本进行处理才可以..........

你可能感兴趣的:(eas,bos,exception,query,join,sql,class,脚本)