Skip to Content

Base Scripting Template for InfoObjects


When using SAP BusinessObjects Enterprise, there are times where it is useful to perform an action on all objects of a particular type.  For example, if you want to delete all instances of a report, or you want to remap the universes for all webi reports.  For these types of tasks, a script can be very useful and significantly faster than making the changes manually.

The code below can be used as a template for looping through all infoobjects an enterprise system and opening them to perform some kind of modification.  This code will work on a BOE XI 3.1 and a BI4 system.

Code Sample

<%@ page import = "com.crystaldecisions.sdk.exception.SDKException,
// User Credentials
String username = "Administrator";
String password = "myPassword";
String cmsname  = "myEnterpriseServer";
String authType = "secEnterprise";

IEnterpriseSession enterpriseSession = null;
IInfoStore infoStore;
IInfoObjects boInfoObjects;

// Log onto Enterprise
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");

// The SI_ID to start at when searching
int max_id = 0;

for(;;) {

// Loop through all objects
boInfoObjects = (IInfoObjects)infoStore.query("Select * FROM CI_INFOOBJECTS WHERE SI_ID > " + max_id + " ORDER BY SI_ID ASC");

// If there are no more objects then we're done.
if(boInfoObjects.size() == 0)

for(Iterator boCount = boInfoObjects.iterator() ; boCount.hasNext() ; ) {
  IInfoObject boObject = (IInfoObject);

  // Here is where you would do all the needed work / modifications
  out.println("The objects is titled " + boObject.getTitle());

  max_id = boObject.getID();