这仅仅是保证了再报表的query里拉出了这个对象不能保证在报表层面也使用了这个对象,,检索的对象名称为“Domestic / International”,在BO4中SDK中已经不提供XI3中的Query对象所以采用另一种办法来做:

参考文档http://bukhantsov.org/2012/11/java-code-to-list-the-objects-used-in-a-webi-4-0-document/

主要用到了webi_client_toolkit.jar 这个包,这个包并不在SAP官网文档中提到,也不再客户端安装目录下,必须要服务器端安装目录下取得C:\Program Files (x86)\SAP BusinessObjects\Tomcat6\webapps\BOE\WEB-INF\eclipse\plugins\webpath.AnalyticalReporting\web\WEB-INF\lib\webi_client_toolkit.jar

<%@page import="java.io.FileOutputStream"%><%@ page language="java" errorPage="err_page.jsp"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.List" %>
<%@ page import="java.io.*" %>
<%@ page import="jxl.Workbook" %>
<%@ page import="jxl.write.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.lang.Iterable" %>
<%@ page import="com.businessobjects.adv_ivcdzview.Utils"%>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IEvents" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObject" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObjects" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.event.IEvent" %>
<%@ page import="com.crystaldecisions.sdk.properties.IProperties" %>
<%@ page import="com.businessobjects.sdk.plugin.desktop.webi.IWebi" %>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.report.IReport" %>
<%@ page import="com.businessobjects.rebean.wi.*" %>
<%@ page import="com.sap.webi.client.toolkit.reporting.ReportDictionaryHelper"%>
<%@ page import="com.businessobjects.sdk.core.Core"%>
<%@ page import="com.businessobjects.sdk.core.context.IContext"%>
<%@ page import="com.sap.sl.dictionary.DictionaryExpression"%>
<%@ page import="com.sap.sl.dictionary.Variable"%>
<%@ page import="com.sap.webi.client.toolkit.Deployment"%>
<%@ page import="com.sap.webi.client.toolkit.LoginKey"%>
<%@ page import="com.sap.webi.client.toolkit.SessionContext"%>
<%@ page import="com.businessobjects.rebean.wi.model.engine.IDocumentInstance"%>
<%@ page import="com.businessobjects.rebean.wi.services.IDocumentInstanceManagementService"%>
<%@ page import="java.util.Locale"%>

<%
 
    IEnterpriseSession enterpriseSession=null ;
    OutputStream os=null;
    WritableWorkbook workbook=null;
        try
     {     
//   IEnterpriseSession enterpriseSession = LoginAndGetSession.getSession();
     //String S_USER=request.getParameter("user").trim();
     //String S_PASS=request.getParameter("pwd").trim();
     //String startDate=request.getParameter("startDate").trim();
     //String endDate=request.getParameter("endDate").trim();
     //String S_HOST="@PPECLUSTER";
     //String S_SECURITY="secEnterpris";
     
     //System.out.println(S_USER);
     //System.out.println(S_PASS);
     //System.out.println(startDate);
     //System.out.println(endDate);
     //System.out.println(S_HOST);
     //System.out.println(S_SECURITY);
     ISessionMgr iSessionMgr = CrystalEnterprise.getSessionMgr();     
     System.out.println("start to log in");
     enterpriseSession=iSessionMgr.logon("adtuser", "***", "*****", "secEnterprise");
    // DocumentInstance doc;
     ReportEngine objReportEngine=null;
     try{
            objReportEngine = (ReportEngine)enterpriseSession.getService("","WebiReportEngine"); ;
            }catch(Exception e){                
            objReportEngine = (ReportEngine)enterpriseSession.getService("ReportEngine"); ;
            }
        
     System.out.println("start to log in2");
     {
         //test
        
     }
       IInfoStore infostore=(IInfoStore)enterpriseSession.getService("InfoStore");//2012.12.01.00.00.00
         //get total of instance
       IInfoObjects allReportcounts= infostore.query("SELECT  count( SI_ID) FROM CI_INFOOBJECTS WHERE SI_KIND in('WEBI')AND SI_INSTANCE=0 and SI_CREATION_TIME<='2011.01.01.00.00.00'" );
       IInfoObject allRportcount=(IInfoObject)allReportcounts.get(0);
       //System.out.print("The total of instance is: "+allReports.size());
       IProperties counts=(IProperties)allRportcount.properties().getProperties("SI_AGGREGATE_COUNT");
       int IDCount=counts.getInt("SI_ID");
       System.out.print("The total of instance is: "+IDCount);
       int k=IDCount;   
       IInfoObjects allReports= infostore.query("SELECT  top "+k+" * FROM CI_INFOOBJECTS WHERE SI_KIND in('Webi') and SI_INSTANCE=0 and SI_CREATION_TIME<='2011.01.01.00.00.00'" );
       String targetfile = "D:\\reportwithLOB8.xls";
       File f=new File(targetfile);
       if(f.exists())f.delete();
       os=new FileOutputStream(targetfile);       
       workbook = Workbook.createWorkbook(os);   
       WritableSheet sheet = workbook.createSheet("Hongrao",0);
       int row=0;
       
           String serializedSession = enterpriseSession.getSerializedSession();
           SessionContext sessionContext = com.businessobjects.adv_ivcdzview.Utils.getSessionContextManager().matchSessionContext(Deployment.DHTML, serializedSession, true);
           Locale localLocale = Locale.getDefault();
           sessionContext.getLoginInfo().set(LoginKey.LOCALE, localLocale);
           sessionContext.logonWithSerializedSession();
           IContext context = sessionContext.getCoreContext();
           IDocumentInstanceManagementService documentInstanceManagementService = Core.getService(IDocumentInstanceManagementService.class);
             
       
       egencia:            
         for (int i=0;i<k;i++)
         {  
             try{
           IWebi a=(IWebi)allReports.get(i);
           //doc= objReportEngine.openDocument(a.getID());
           // a.getso
           {}
          
         String path="";
         String docName="";
         String createdate="as";
         String lastdate="as";
         SimpleDateFormat sdf  =   new  SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
         {
           IInfoObject reportFolder = a.getParent();
           docName=a.getTitle();
           createdate=sdf.format( a.properties().getDate("SI_CREATION_TIME"));
           lastdate=sdf.format( a.properties().getDate("SI_UPDATE_TS"));
           
       //   System.out.print(a.getTitle()+"\n");
           if (a.getParentID() == 0)
                       path="Public Folders";
                 else
                 { try{
                       while (1 > 0)
                       {
                             path = reportFolder.getTitle() + "/" + path;
                           //  System.out.print(" Report path "+reportFolder.getTitle());
                             if (reportFolder.getParentID() == 0)
                             {path = "Public Folders"+ "/" + path;
                             // System.out.print(path+"\n");
                              
                                   break;
                             }
                             else
                             {
                                   reportFolder = reportFolder.getParent();
                                   //System.out.print(reportFolder);
                             }
                       }
                 }catch(Exception es){}
                 }
          
           
         }
         
         if(path.toLowerCase().indexOf("egencia")<0) continue;
         {

IDocumentInstance doc =documentInstanceManagementService.openDocument(context, a.getID());
             List <DictionaryExpression>list = ReportDictionaryHelper.getDictionaryObjectsFlatList(context, doc);
           
             int have=0;
             if (list.size() > 0) {
               System.out.println(a.getTitle()+" OBJECTS:"+i+":"+list.size());
              // for(int g=0;g<list.size();g++){
                   //System.out.println(expr.getName());
                  // list.
               //}
             
               for (DictionaryExpression expr:list) {
                 
                 if(expr.getName().indexOf("nternatio")>1 && expr.getName().indexOf("mestic")>1)
                 { have=1;
                 System.out.println(expr.getName());
                 
                 break;
                 }
               }
               
             }
             documentInstanceManagementService.closeDocument(context, doc);
            if(have==0) continue egencia;
            
             
         }
         Label labelcon1=new Label(0,row,path);
         Label labelcon2=new Label(1,row,docName);
         Label labelcon3=new Label(2,row,createdate);
         Label labelcon4=new Label(3,row,lastdate);
         sheet.addCell(labelcon1);
         sheet.addCell(labelcon2);
         sheet.addCell(labelcon3);
         sheet.addCell(labelcon4);
         row+=1;
             }catch(Exception eh){}
         }
         workbook.write();
         workbook.close();
         os.close();
         out.print("sucess!");
        
     }
        catch(SDKException sdk){
            workbook.close();
            os.close();
            out.print(sdk.getMessage());}
        finally{
            enterpriseSession.logoff();
        }
%>

BO4 SDK 检索所有使用了某个universe object的报表相关推荐

  1. BOXI3 SDK 检索所有使用了某个universe object的报表

    这仅仅是保证了再报表的query里拉出了这个对象不能保证在报表层面也使用了这个对象,在下一篇中也是同理,检索的对象名称为"Domestic / International" < ...

  2. 百度地图 Android SDK - 检索功能使用的简单演示样例

    百度地图 SDK 不仅为广大开发人员提供了炫酷的地图展示效果.丰富的覆盖物图层,更为广大开发人员提供了多种 LBS 检索的能力. 通过这些接口,开发人员能够轻松的訪问百度的 LBS 数据,丰富自己的移 ...

  3. android spen加背景网页,Android SPen SDK检索悬停点

    我需要使用SPen检索所有点(包括手写笔未触摸时拾取的点). 我已经设法从PageDoc的getObjectList中检索点,压力和时间戳,请参阅下面的snippit,但这些不包括悬停点. Array ...

  4. 百度地图AR识别SDK免费推出

    在今年的9月份,百度地图开放平台曾做过一期关于<LBS+AI新浪潮,不止于此>的主题沙龙,现场开发者反响爆棚,也一起探索了在AI技术的加持下,地图产品及依赖于位置服务相关的开发者产品将有哪 ...

  5. Android 集成百度地图AR识别SDK(一)

    废话 我最近一直在想手机上如何实现AR功能,很多方法都试过了,但是要不是一些官方文档看不懂,要不就是集成起来特别麻烦,总之就是无从下手 有一天,一位同事突然和我说百度地图有AR功能,于是我赶紧试了下, ...

  6. 飞信SDK内容【转载】

    使用飞信SDK开发短信收发程序 2008-10-13 13:57 利用飞信的协议可以在线收发消息,或是向手机发送消息.由此,可以自己来完成一个IM工具. 本文即是对飞信SDK的使用方法,及如何开发作一 ...

  7. 隐私政策-第三方SDK汇总

    一.模版: 使用SDK名称:第三方SDK的名字 服务类型:根据自己使用的功能填写(如:使用了友盟的统计分析SDK就写:统计分析) 收集个人信息类型:设备信息(IMEI/MAC/Android ID/I ...

  8. App隐私合规协议(第三方SDK)说明

    一.模版: 使用SDK名称:第三方SDK的名字 服务类型:根据自己使用的功能填写(如:使用了友盟的统计分析SDK就写:统计分析) 收集个人信息类型:设备信息(IMEI/MAC/Android ID/I ...

  9. linux第三方SDK库冲突,摄像机SDK对接第三方平台一SDK库问题FAQ

    Q1:IVS_PU_Player.dll的作用是什么?在调用HWPuSDK.dll时是否必须调用IVS_PU_Player.dll? A1:IVS_PU_Player.dll是媒体播放库,主要用在显示 ...

最新文章

  1. ASP.NET2.0轻松搞定统计图表【月儿原创】
  2. 有关try..catch..finally处理异常的总结
  3. 国拨经费约31.48亿!科技部发布科技创新2030 —“脑科学与类脑研究”重大项目2021年度项目申报指南...
  4. java品酒会,我学 rxjava 2(3)- 热发射
  5. MySQL中using的用法
  6. OLAP组件-Clickhouse源码
  7. “碰瓷”特斯拉翻船,卡车界明星创企Nikola身陷“骗局”危机
  8. 数据传输服务 DTS > 数据订阅 > 数据订阅(新版) > 创建RDS MySQL数据订阅通道(新版)
  9. vue 左右循环滑动_vue实现无缝滚动循环
  10. CUDA ---- Warp解析
  11. python标准库说明_Python标准库详细介绍与基本使用方式,超详细!
  12. 中兴2018年上半年业绩惨不忍睹,押宝5G建设能否让其起死回生?
  13. 计算机多媒体故障,多媒体教室设备常见故障及处理方法
  14. 电子信息工程专业打工人的蓝桥杯嵌入式竞赛时记
  15. 用友NC报表行数能否配置
  16. 图论(5)邻接谱,邻接代数,图空间,托兰定理
  17. 炫酷文字消失动画网站404页面源码
  18. vue怎么在地址栏隐藏路由
  19. TTP223-BAT功能简介
  20. 强迫症狂喜!PC端相册还能智能分类!

热门文章

  1. MeteoInfoLab脚本示例:站点填图
  2. 45页精华《2022中国建筑行业数字化转型研究报告》出炉(附下载)
  3. 布衣联盟XP SP2之国兴奥运版
  4. RabbitMQ详解以及spring对RabbitMQ的集成(附带部分源码解读)
  5. 机器学习之梯度下降法(GD)、随机梯度下降法(SGD)和随机平均梯度下降法(SAGD)
  6. python搭建 ADLINE 网络判断男女
  7. 【接口技术】实验二:基本I/O实验
  8. Download EEGLAB
  9. php微信一次性订阅消息demo,微信一次性订阅消息
  10. 法国内政部选择由金雅拓保护该国关键的通信移动网络