There have been many requirements about getting the full folder location of all the reports(crystal/webi/deski) in the enterprise system. The information can be figured out using the query builder by executing multiple queries but it becomes time consuming as well as difficult when this information has to be retrieved for a large number of reports.
Using Query Builder
Using the query builder(AdminTools Application), and execute the below query
SELECT SI_ID,SI_NAME,SI_PARENTID FROM CI_INFOOBJECTS WHERE SI_KIND IN(‘cryatalReport’,’Webi’,’Deski’) AND SI_INSTANCE=0, you get to list the id, name and parentId of all the crystal/webi/deski reports. The SI_PARENTID property bag contains the id of the object which is parent for a particular report. In basic scenarios, the parent of a report can be a folder, objectpackage, FavoritesFolder or an Inbox.
Again executing the below query in the query builder you can get the name of the parent.
SELECT SI_ID,SI_NAME,SI_PATH FROM CI_INFOOBJECTS WHERE SI_ID=<Parent-Id retrieved from the previous query>
If the above query returns a folder(SI_KIND=Folder), then the SI_PATH property bag contains the hierarchy of folders. i.e it contains the name of the folders this object belongs to. The SI_PATH property bag has a sub property bag “SI_NUM_FOLDERS” which contains a numeric value and it lets you know the number of folders this partcular folder has as its parents in hierarchy.
Consider a report is inside an objectPackage, then the parent of the report becomes an object package who inturn has a parent as a folder.
Thus using the query builder, this becomes a two step query.
First, to get the parentid of the report, then to get the name of the object package and get the parent id of the object package and then again execute a query to get the folder name and path.
Using BusinessObjects Enterprise SDKs
The below code lists folder path of all the reports(crystal/webi) in the enterprise system.
For other scripts and information on how to run these scripts see here:
|Get Folder Path|
<%@ page import=”com.crystaldecisions.sdk.properties.*” %>
ISessionMgr sm = CrystalEnterprise.getSessionMgr();
IInfoStore iStore = (IInfoStore)es.getService(“”,”InfoStore”);
String sq = “select si_id,si_name,si_parentid from ci_infoobjects where si_kind in (‘CrystalReport’,’Webi’) and si_instance=0”;
IInfoObjects iObjects = iStore.query(sq);