3

我需要阅读包含表格和列的 Webi 报告元数据信息。我可以读取一些 Webi 报告元数据信息,但对于组合和联合 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);
        }
    }
}
4

1 回答 1

2

在 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-网络直播

于 2013-05-09T08:59:59.080 回答