Skip to Content
Author's profile photo Former Member

Getting the lists of all web intelligence reports with ‘refresh on open’ option checked and their folder locations in the enterprise using Java SDK

There have been many requirements about getting the list and full folder location of all the web intelligence reports with refresh on open option checked 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 executing the below query:

For checking the webi report is saved with refresh on open option or not, we run following query:


In above query result we check if the “is_refresh_on_open” is set to true or false.

SELECT SI_ID,SI_NAME,SI_PARENTID FROM CI_INFOOBJECTS WHERE SI_KIND =’Webi’ AND SI_INSTANCE=0, you get to list the id, name and parentId of all the webi 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 multi-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 web intelligence reports saved with refresh on open optioned checked and their folder path in the enterprise system.


For other scripts and information on how to run these scripts see here:

Sample code to achieve above

<%@ page import=”com.crystaldecisions.sdk.framework.*” %>
<%@ page import=”com.crystaldecisions.sdk.occa.infostore.*” %>
<%@ page import=”com.crystaldecisions.sdk.plugin.CeKind” %>
<%@ page import=”com.businessobjects.rebean.wi.*” %>
<%@ page import=”java.util.Properties” %>
<%@ page import=”*” %>
<%@ page import=”com.crystaldecisions.sdk.plugin.desktop.folder.*” %>
<%@ page import=”java.util.*” %>
<%@ page import =”org.apache.poi.hssf.usermodel.HSSFSheet”%>
<%@ page import =”org.apache.poi.hssf.usermodel.HSSFWorkbook”%>
<%@ page import =”org.apache.poi.hssf.usermodel.HSSFCell”%>
<%@ page import =”org.apache.poi.hssf.usermodel.HSSFRow”%>
<%@ page import =”*”%>
<%@ page import =”org.apache.poi.hssf.usermodel.HSSFPrintSetup”%>

/************************** RETRIEVING PARAMETERS **************************/

// Retrieve the logon information
String username = “<User_Name>”;
String password = “<User_Password>”;
String cmsName  = “<CMS_NAME>”;
String authType = “<Auth_Type>”;
DocumentInstance boDocumentInstance=null;
ReportEngine boReportEngine=null;
IInfoStore boInfoStore=null;
IInfoObjects boInfoObjects=null;
String reportOwner=null;

  HSSFWorkbook wb = new HSSFWorkbook();
  HSSFSheet sheet = wb.createSheet(“new sheet”);
  HSSFRow rowhead = sheet.createRow((short)0);
  rowhead.createCell((short) 0).setCellValue(“Report ID”);
  rowhead.createCell((short) 1).setCellValue(“Report Name”);
  rowhead.createCell((short) 2).setCellValue(“Report Owner”);
  rowhead.createCell((short) 3).setCellValue(“Folder Location”);
  int index = 1;


// Retrieve the name of the Web Intelligence document to be used in the sample
String webiDocName = null;

// Retrieve the refresh flag
String refreshOnOpen = “false”;
String Chk=”true”;

/************************** LOGON TO THE ENTERPRISE **************************/

// Logon to the enterprise
IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsName, authType);

/************************** RETRIEVE INFOOBJECT FOR THE WEBI DOCUMENT **************************/

// Retrieve the IInfoStore object
boInfoStore =(IInfoStore) boEnterpriseSession.getService(“InfoStore”);

// Build query to retrieve the InfoObjects for Web Intelligence document

// Execute the query
boInfoObjects = (IInfoObjects) boInfoStore.query(query);
for(int i =0; i<boInfoObjects.getResultSize();i++)
  // Retrieve the first InfoObject instance of the Web Intelligence document
  IInfoObject boInfoObject = (IInfoObject) boInfoObjects.get(i);

  int reportID=boInfoObject.getID();
  String reportName=boInfoObject.getTitle();
  String finalFolderPath=””;

// Retrieve the Report Engines
ReportEngines boReportEngines = (ReportEngines) boEnterpriseSession.getService(“ReportEngines”);;

// Retrieve the Report Engine for Web Intelligence documents
    boReportEngine = boReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);

// Retrieve the document instance for the Web Intelligence document
boDocumentInstance = boReportEngine.openDocument(boInfoObject.getID());

// Retrieve the properties of the document
Properties properties = boDocumentInstance.getProperties();

HSSFRow row = sheet.createRow((short)index);
out.println(“<BR>Report ID :”+reportID);
out.println(“<BR>Report Name :”+reportName);
row.createCell((short) 0).setCellValue(reportID);
row.createCell((short) 1).setCellValue(reportName);

IProperties instanceOwnerProperties=(IProperties);
IProperty reportOwnerProperty=instanceOwnerProperties.getProperty(“SI_OWNER”);

  if(reportOwnerProperty != null)
   out.println(“<BR>Report Owner :”+reportOwner);

row.createCell((short) 2).setCellValue(reportOwner);

IProperties prop =;
IProperty getProp = prop.getProperty(“SI_PARENTID”);
String FolderID = getProp.toString();
IInfoObjects folder = boInfoStore.query(“select si_id,si_name,si_parentid,si_path from ci_infoobjects where si_id=” + FolderID);
IInfoObject ifolder=(IInfoObject)folder.get(0);  


   IFolder iifolder=(IFolder)ifolder;

   if(iifolder.getPath()!= null)
    String path[]=iifolder.getPath();
     for(int fi=0;fi<path.length;fi++)
       finalFolderPath = path[fi] + “/” + finalFolderPath;
     finalFolderPath = finalFolderPath + iifolder.getTitle();
     row.createCell((short) 3).setCellValue(finalFolderPath);
   out.println(“<BR> Folder Path : ” + finalFolderPath);
   row.createCell((short) 3).setCellValue(finalFolderPath);
  else if((ifolder.getKind().equals(“FavoritesFolder”)))
   String fFolder=”FavoritesFolder  :  ” + ifolder.getTitle();
   out.println(“<BR> Folder Path:   FavoritesFolder</b>  ::  ” + ifolder.getTitle());
   row.createCell((short) 3).setCellValue(fFolder);
  else if((ifolder.getKind().equals(“Inbox”)))
   out.println(“<BR> <b>Inbox</b>  ::  ” + ifolder.getTitle());
   String inbox=”Inbox : ” + ifolder.getTitle();
   row.createCell((short) 3).setCellValue(inbox);
  else if((ifolder.getKind().equals(“ObjectPackage”)))
   out.println(“<BR> <b>ObjectPackage</b>  ::  ” + ifolder.getTitle());
   IProperties prop1 =;
   IProperty getProp1 = prop1.getProperty(“SI_PARENTID”);
   String FolderID1 = getProp1.toString();
   IInfoObjects folder1 = boInfoStore .query(“select * from ci_infoobjects where si_id=” + FolderID1);
   IInfoObject ifolder1=(IInfoObject)folder1.get(0);   
    IFolder iifolder1=(IFolder)ifolder1;
    String finalFolderPath1=””;
    if(iifolder1.getPath()!= null)
     String path[]=iifolder1.getPath();
     for(int j=0;j<path.length;j++)
      finalFolderPath1= path[j] + “/” + finalFolderPath1;
     finalFolderPath1 = finalFolderPath1 + iifolder1.getTitle()+”/”+ifolder.getTitle();
    out.println(“<BR> Report Folder :  “+ finalFolderPath1 + “<br />”);
    String oPackage=” ObjectPackage : ” + ifolder.getTitle();
    row.createCell((short) 3).setCellValue(oPackage);

boDocumentInstance = null;
boReportEngine = null;
out.println(“<BR><BR>Process Complete.”);

/************************** CLEAN UP **************************/
boEnterpriseSession = null;

catch(Exception e)
  FileOutputStream fileOut = new FileOutputStream(“c:\\ReportDetails.xls”);
  out.println(“<BR> Excel file created successfully”);

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Great Piece of information with sample code Surly it would help a lot many people. 



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Mahesh.



      Author's profile photo Former Member
      Former Member

      Keep ahead Good work

      Author's profile photo Bhushan Hyalij
      Bhushan Hyalij

      Beautifully illustrated.. Nice work!!

      Author's profile photo Amit Anant Kulkarni
      Amit Anant Kulkarni

      Awesome document

      Author's profile photo Sohel Ahmed Syed
      Sohel Ahmed Syed

      Excellent work, very useful script.

      Thanks for sharing.

      Author's profile photo Prithviraj Shekhawat
      Prithviraj Shekhawat

      Nice Article. Keep up the good work.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thank you all 🙂

      Author's profile photo Former Member
      Former Member

      Great work Feroz Khan!!!

      Author's profile photo Rahul Verma
      Rahul Verma

      Good one Feroz 🙂

      Author's profile photo Former Member
      Former Member

      Good one Feroz, really helpful.

      Author's profile photo Former Member
      Former Member

      Did some one tried this? Not working for me. Do i need a poi.jar file for this?

      Removed the excel part and tried to display in HTML and i got this error DocumentInstance cannot be resolved to a type also same issue with the Report engine.