2013-05-06 74 views
2

我需要閱讀具有表格和列的web報告metedata信息。我可以讀取少量webi報告metedata信息,但對於組合和獨特的webi報告,我無法讀取任何metedata數據信息。對於這種報告,我收到了空值查詢。任何人都可以讓我知道如何從中讀取metedata數據。如何閱讀來自BO Java SDK的聯合報告和組合webi報告

代碼:

String query="SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND in('WEBI') AND SI_INSTANCE = 0 AND SI_ANCESTOR = 23"; 

sessionMgr = CrystalEnterprise.getSessionMgr(); 
enterpriseSession = sessionMgr.logon(username,password,ip,"secEnterprise"); 
reportEngines = (ReportEngines) enterpriseSession.getService("ReportEngines"); 
ReportEngine wiRepEngine(ReportEngine)reportEngines.getService(
    ReportEngines.ReportEngineType.WI_REPORT_ENGINE); 
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore"); 


IInfoObjects infoObjects = (IInfoObjects) infoStore.query(query); 
System.out.println(infoObjects.size()); 

for (int i =0; i<infoObjects.size(); i++) 
{ 
    IInfoObject report = (IInfoObject)infoObjects.get(i); 
    widoc = wiRepEngine.openDocument(report.getID()); 
    providers = (DataProviders) widoc.getDataProviders(); 
    for(int prov=0; prov<providers.getCount(); prov++) 
    { 
     DataProvider providername = providers.getItem(0); 
     DataSource datasource= providername.getDataSource(); 
     String universename=datasource.getName(); 
     Query providetgetQuery=providername.getQuery(); 
     System.out.println("Query:-"+providername.getQuery()); 
     for(int k=0; k<providetgetQuery.getResultObjectCount(); k++) 
     { 
      providerQueryChild=providetgetQuery.getResultObject(k); 
      System.out.println("Columns:-"+providerQueryChild); 
      TreeNode providerQueryparent=providerQueryChild.getParent(); 
      System.out.println("Tables:-"+providerQueryparent); 
     } 
    } 
} 
+0

BO的什麼版本? 3.1? 4.0? – Samoth 2013-05-09 08:32:22

+0

我正在使用BORX4 – Navyah 2013-05-09 09:57:48

回答

1

在BO 3.1:

相反:

Query providetgetQuery=providername.getQuery(); 

試試這個:

Query providetgetQuery; 
if (providername.hasCombinedQueries()) { 
    providetgetQuery = (Query) providername.getCombinedQueries().getQueryNodeAt(0); 
} else { 
    providetgetQuery = providername.getQuery(); 
} 

在BO 4.0中:

目前Report SDK的這部分不可用。 看看什麼是可用:http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_rebean_omd.pdf

應當提供BO 4.1: http://scn.sap.com/community/bi-platform/blog/2012/11/18/what-is-coming-in-businessobjects-bi41-customer-validation-asug-webcast

+0

還沒有它變爲空。我需要具有2個Universe名稱的報告的表和列信息 – Navyah 2013-05-09 10:06:22