我需要阅读包含表格和列的 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);
}
}
}