获取业务对象webi报告的文件夹

时间:2011-05-04 09:07:57

标签: java business-objects-sdk

我有关于webi服务器的报告。我需要一个代码段来显示报告所在的文件夹。

1 个答案:

答案 0 :(得分:0)

首先需要的是您正在寻找的WebI报告的IInfoObject。在那之后是针对IInfoStore的几个查询,循环通过SI_PARENTID值,你会得到回来。

IInfoObject myReport; // the WebI report you are trying to find the folder it is in
IInfoStore infoStore; // your gateway to the CMS database

// I'm not sure what info is in your myReport IInfoObject, so make sure we have what is needed
String infoStoreQuery = "select SI_ID,SI_NAME,SI_PARENTID from CI_INFOOBJECTS where SI_ID="+myReport.getID();
IInfoObjects infoObjects = infoStore.query(infoStoreQuery);

// because I used the ID there should be only 1 object in the infoObjects
IInfoObject myReportWithParentFolder = (IInfoObject)infoObjects.get(0);
int parentFolderId = myReportWithParentFolder.getParentID(); // ID of the folder that contains the report

// BEGIN now loop through the folders going backwards to get full path to the report
// loop not shown
infoStoreQuery = "select SI_ID,SI_NAME,SI_PARENTID from CI_INFOOBJECTS where SI_ID="+parentFolderId ;
infoObjects = infoStore.query(infoStoreQuery);
IInfoObject folder = (IInfoObject)infoObjects.get(0);
String folderName = folder.getTitle();
int parentFolderId = folder.getParentID(); 
// END loop area